This is a bug.
What is the current behavior?
~~~~
cd package1/
yarn link
info You can now runyarn link "@company/package1"
in the projects where you want to use this module and it will be used instead.
cd package2/
yarn link "@company/package1"
yarn add "@company/package1"
error An unexpected error occurred: "https://registry.yarnpkg.com/@company%2fpackage1: Not found".
~~~~
The same error occurs if the named package is already in package.json
before calling yarn install
.
NOTE: yarn link
seems to create the appropriate symlink. I.e.,
~~~
./node_modules/@company/package1 -> ../../../package1
~
I've also confirmed that yarn install
works if I'm just using the published package (i.e., not using link
).
If the current behavior is a bug, please provide the steps to reproduce.
ABOVE.
What is the expected behavior?
The linked package should be used.
Please mention your node.js, yarn and operating system version.
node v9.2.1
yarn 1.3.2
OS/X 10.13.1
Why are you doing yarn add "@company/package1"
?
That's my scoped package. I.e., I have an npm organization @company
(I mean it's not called that, but for example) and a private package called package1
.
We are having the same issue :cry: Any news on this?
We use npm's private organisation scope and have had issues getting them installed with Yarn.
My workaround was to explicitly set my Yarn registry to https://registry.npmjs.org/
(i.e. our organisation private registry happens to be the npm registry) and I am now able to link and install my private scoped organisation modules.
$ yarn config set registry https://registry.npmjs.org/
This is with Yarn 1.3.2 on Windows 10
I can confirm this issue with Yarn 1.3.2 on macOS Sierra 10.12.6
Same issue
I have the same issue.
@Coridyn your registry change worked: $ yarn config set registry https://registry.npmjs.org/
The registry hack doesn't seem to be working for me on yarn 1.10.
Any update here? Also does not work with v1.12.0!
Same error with version 1.12.3
. What's the status of this issue given that some other people also faced it? 馃
Recently I switch from Dart to TS and I'm always surprised how such thing like working with local modules/packages can still be a problem in the JS world. 1.12.3
My coworker has this problem on MacOS (Sierra 10.12.6) with yarn 1.13.0.
yarn link
with scoped packages works fine for me on Windows 10 (yarn 1.10.1).
still a thing with yarn 1.19.1 on Win 7, I'm afraid.
Also have this issue on MacOS 10.14.6
Workaround for me was to escape the forward-slash and manually add to package.json
dependencies:
yarn link @company\/package-name
I have the same issue on linux machine and the solution provided by @simpleshadow works for me :+1:
Most helpful comment
Recently I switch from Dart to TS and I'm always surprised how such thing like working with local modules/packages can still be a problem in the JS world.
1.12.3