简体   繁体   English

npm install -g,但始终在本地安装

[英]npm install -g but always installed locally

I am using window, and my npm always install my package locally even though I add -g flag after the command: npm install gulp -g 我正在使用window,即使我在命令后添加-g标志,我的npm也会始终在本地安装软件包: npm install gulp -g

How can I solve this problem? 我怎么解决这个问题? I want to share the node module among projects. 我想在项目之间共享节点模块。

>npm -v
3.10.3

>node -v
v6.7.0

>npm list -g
`-- (empty)

You may have a broken alias in your shell. 您的外壳中的别名可能已损坏。 Try running: \\npm i -g gulp 尝试运行: \\npm i -g gulp

to verify what path you are using for npm run: type npm Or Which npm 验证用于npm运行的路径: type npmWhich npm

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM