bitten bitten - 2 months ago 10
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?


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/