I want to local link all the explicit dependencies stated in my package.json
.
If I just try npm link
what I get is a local install of all of the packages, independently of whether or not they are already globally installed.
I didn't expect that. What I expected, and what I needed, is a behavior similar as if I'd do a npm link package
. I wanted npm link
to inspect the dependencies in package.json
and for each of the, to create the link, and do a global install if needed.
npm link
isn't designed to work that way. There are two ways to use it, and both depend on you downloading the dependency you want to link beforehand.
cd ../dependency
npm link
cd ../project
npm link dependency
cd project
npm link ../dependency
I think what you're trying to do is npm link
where the target is a globally installed package (as opposed to a globally installed link to some directory on your filesystem). npm
doesn't support that.
Ref: https://docs.npmjs.com/cli/link
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With