在package.json中将bower添加为devDependency [英] adding bower as devDependency in package.json

查看:87
本文介绍了在package.json中将bower添加为devDependency的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用node.js和bower。我想在全球范围内安装凉亭。另外,我需要将它包含在 devDependency 下的 package.json 文件中。

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.

所以我尝试过,

npm install -g bower --save-dev

Bower已成功安装,但我看不到package.json文件正在更新。可能是什么问题?

Bower is installed successfully but I don't see the package.json file is getting updated. What could the issue?

推荐答案

可能是因为您要在全球范围内安装它。

Probably because you're installing it globally. When you install it globally, it won't get saved locally.

要通过本地安装,可以通过 npm init

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.

这篇关于在package.json中将bower添加为devDependency的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆