I have a directory structure like this: /a/b/c
Directory c
contains package.json
and should contain node_modules
.
How can I execute npm install
from inside directory a
?
I tried this way: npm --prefix b/c install b/c
but this way, all the symlinks are created directly inside c
instead of the default node_modules/.bin
.
Is there any way to achieve that?
node: 6.2.2
npm: 3.10.2
Using an npm pre install hook in a package.json
within your a
directory is likely the best choice in this situation.
scripts: {
preinstall: `cd b/c && npm install`
}
This way running npm install
in directory a
will also do the c
directory install and provide a seamless dev experience.
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