yarn
yarn copied to clipboard
yarn link error message is not helpful
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
Running link for a linked package shows:
warning There's already a package called "vega" registered. This command has had no effect. If this command was run in another folder with the same name, the other folder is still linked. Please run yarn unlink in the other folder if you want to register this folder.
What is the expected behavior?
There is no note about where the link is so it's hard to unlink.
Please mention your node.js, yarn and operating system version.
yarn 1.13.0
For anyone else coming here, you can delete the link in ~/.config/yarn/link
+1 On this. I strongly suggest getting rid of this error message entirely and changing the behavior. Just overwrite the existing link. That's what npm does, and in my experience is the most helpful behavior in 99% of cases.
Or have a -f flag to override the link.
One way to find where the original link points to is viewing the symlink that yarn creates: ls -lsa ~/.config/yarn/link
.
Another frustration with this error message is that it will appear even if you are in the originally linked directory.
On Windows delete the link in : C:\Users<user name>\AppData\Local\Yarn\Data\link
This message and the behaviour is baad. The default assumption should be to overwrite the link IMO.
- Keep the default behaviour no one wants but add a helpful message like "Remove the link at {path}"
- Provide flags like sym link does to overwrite (-sfn)
- Go with the assumption that everyone wants to create a link when they type yarn link, which I think they do
2 years later. Error is still the exact same form as in 2019. this is just sad...
Will be good to show, at least, the current location of already registered link in output message! And do not warn if the link is already pointing to current folder.
Just as FYI because I found this issue. You can simply just run yarn unlink -g <package>
and it's unlinked.
On Windows delete the link in : C:\Users
\AppData\Local\Yarn\Data\link
For (lazy) windows users the generic url (Copy/Paste in the explorer)
%userprofile%\AppData\Local\Yarn\Data\link
To ignore the warning, you can run yarn link 2> /dev/null
on unix system, see https://linuxhandbook.com/redirect-dev-null/ for more
For anyone else coming here, you can delete the link in
~/.config/yarn/link
On CentOS the path is /usr/local/share/.config/yarn/link