#6880·yarn

Yarn link does not work

Author: ApolloTangCreated Jan 6, 2019Updated Mar 28, 2026
Labelstriaged

This is a bug report

Current behavior, and step to produce:

To illustrate the problem (bug) I have created a sample repo, which you can find at: https://github.com/ApolloTang/issue-yarn-link-does-not-work

It has two folders: one has content which is the dependency package, the other a project that using the dependency package:

~/1/1-a/16-tools/yarn-link/issue-yarn-link-does-not-work
$ tree -F
.
├── dependency/
│   ├── index.js
│   ├── node_modules/
│   ├── package.json
│   └── yarn.lock
└── using-dependency/
    ├── index.js
    └── package.json

in dependency/ folder:

$ yarn link

screenshot:

screen shot 2019-01-06 at 1 37 07 pm

This created a link in my ~/.config/yarn/link. To confirm this :

cd ~/.config/yarn/link; ls -l 

screenshot:

screen shot 2019-01-06 at 1 26 54 pm

My ~/.config/yarn has the following structure:

screenshot: screen shot 2019-01-06 at 2 04 47 pm

From the above the link is indeed pointing to my dependency folder. To confirm:

screenshot:

screen shot 2019-01-06 at 1 31 24 pm

Now that the link has created I can cd to the project folder to link the dependency; However, I got

error No registered package found called ....

screenshot:

screen shot 2019-01-06 at 1 41 38 pm

I also notice that if I go back to the dependency package folder, yarn can not unlink the package:

screenshot:

screen shot 2019-01-06 at 1 50 52 pm

It seem like yarn link does not know where the directory~/.config/yarn/link is.

Here is the output of my yarn config list:

screen shot 2019-01-06 at 2 01 06 pm

Here is the content of my .yarnrc:

screen shot 2019-01-06 at 2 00 11 pm

Here is my environment:

screenshot: screen shot 2019-01-06 at 2 10 51 pm