Adding bower as devDependency in package.json

I am using node.js and bower. I want to establish a conversation at a global level. In addition, I need it to be included in the package.jsonfile under devDependency.

so I tried

npm install -g bower --save-dev

Bower installed successfully, but I don't see that the package.json file is being updated. What is the problem?

+4
source share
1 answer

Perhaps because you install it globally. When you install it globally, it will not be saved locally.

To be able to use it locally, through npm inityou can include it in devDependenciesand then refer to it as ./node_modules/.bin/bowersince npm stores executable files there.

+6

All Articles