bitten bitten - 1 year ago 76
Bash Question

Trigger `npm install` for a certain directory in a shell script

I'm in a shell script running in

and I'd like to trigger
npm install
. Is it possible to do this?

Answer Source

You can use the --prefix option:

npm install --prefix ~/folder2/ packagename 

You just have to omit the packagename to install from the package.json

npm install --prefix ~/folder2/
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download