volta
volta copied to clipboard
Allow use of `npm link ../relative-directory`
If you try to use modules from sibling directories to the current one, npm allows you to specify a relative path to create a link.
It appears that volta disallows this, and requires you to go into the other directory, link, and then npm link package-name
in the current directory.
It's fairly inconvenient, but I think should be easy enough to fix since it's really just bundling two operations.
Hi @antony, thanks for reporting this! That use-case definitely wasn't covered by our initial implementation. It's a bit tricky to implement as-is, due to how we handle the two link commands separately. However, one approach we could take would be to separate the two in the same way that npm link
does: Run them as two commands effectively back-to-back: npm link
(in the target directory) and then npm link <package name>
in the current directory.
As a workaround, I've been using a different npm. I'm on macOS using homebrew and running /opt/homebrew/bin/npm link
.
~Why does Volta change how npm cli works, does it do more than install it?~ Conversation continued in: https://github.com/volta-cli/volta/issues/1001#issuecomment-1051404288
It still doesn't work