adding bower as devDependency in package.json

风流意气都作罢 提交于 2019-12-23 15:25:46

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!