How to install package with local path by Yarn? It couldn't find package

For yarn version < 2.x

Yarn requires prefix file: for local packages.

For relative path:

yarn add file:./../your-project

For absolute path

yarn add file:/dev/your-project

For your example, dependency in package.json would be declared as follows:

 "my-custom-i18n": "file:./../MyProject.Shared/myproject-i18n",

This works both for Yarn and NPM as well.

It is incompatibility with NPM client, Yarn team is aware and declared to support this behavior - reference on GitHub issue.

Update:

Since v0.21.0 release, file: prefix is not needed. See pull-request with fix and changelog.