Suppose that somewhere in my package.json
I have:
"dependencies": {
"bower": "1.0.0",
// zillion other dependencies
}
Is there a way to make npm install only [email protected] from my package.json
? Like so: npm install --only bower
.
My goal is to make npm install
and bower install
run simultaneously.
As a workaround you may use something like:
> node -p -e "require('./package.json').dependencies.bower"
// → 1.0.0
> npm install bower@`node -p -e "require('./package.json').dependencies.bower"`
// → npm install [email protected]
Where -e/--eval
flag evaluates passed string and -p/--print
prints result of eval.
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句