Yarn: Yarn Link doesn't support path to match npm

Created on 15 Oct 2016  Â·  2Comments  Â·  Source: yarnpkg/yarn

Do you want to request a _feature_ or report a _bug_?

Bug

What is the current behavior?

kstone@kstone-mbp $PWD> yarn link .
yarn link v0.15.1
error Couldn't find a package.json (or bower.json) file in $HOME/.yarn-cache/.link
[...]
kstone@kstone-mbp $PWD> yarn link 
yarn link v0.15.1
success Registered "$PKG".
info You can now run `yarn link "$PKG"` in the projects where you want to use this module and it will be used instead.
✨  Done in 0.06s.

If the current behavior is a bug, please provide the steps to reproduce.

See above.

What is the expected behavior?

kstone@kstone-mbp $PWD> npm link .
[...]
/usr/local/lib/node_modules/$PKG -> $PWD

Please mention your node.js, yarn and operating system version.

kstone@kstone-mbp $PWD> node --version
v6.8.1
kstone@kstone-mbp $PWD> yarn --version
0.15.1
kstone@kstone-mbp $PWD> sw_vers 
ProductName:    Mac OS X
ProductVersion: 10.12
BuildVersion:   16A319
cat-feature help wanted needs-discussion triaged

Most helpful comment

I can confirm that passing relative paths to yarn link fails.

For example, within an application in which I want to link in a Webpack configuration package for testing:

$ yarn link ../webpack-config/
yarn link v0.19.1
error No registered module found called "../webpack-config/".
info Visit https://yarnpkg.com/en/docs/cli/link for documentation about this command.

I probably wouldn't call this a bug, so much as a feature in npm (https://docs.npmjs.com/cli/link) that has not been implemented in yarn yet.

All 2 comments

I can confirm that passing relative paths to yarn link fails.

For example, within an application in which I want to link in a Webpack configuration package for testing:

$ yarn link ../webpack-config/
yarn link v0.19.1
error No registered module found called "../webpack-config/".
info Visit https://yarnpkg.com/en/docs/cli/link for documentation about this command.

I probably wouldn't call this a bug, so much as a feature in npm (https://docs.npmjs.com/cli/link) that has not been implemented in yarn yet.

Send a PR to support it

Was this page helpful?
0 / 5 - 0 ratings