问题
I'm using node.js and bower. I want to install bower at global level. Also, I need it to be included in the package.json
file under devDependency
.
so I tried,
npm install -g bower --save-dev
Bower is installed successfully but I don't see the package.json file is getting updated. What could the issue?
回答1:
Probably because you're installing it globally. When you install it globally, it won't get saved locally.
To be able to use it locally, through npm init
, you can include it in the devDependencies
, and then reference it as ./node_modules/.bin/bower
, since npm stores executables there.
来源:https://stackoverflow.com/questions/25177442/adding-bower-as-devdependency-in-package-json