【发布时间】:2023-04-03 23:49:01
【问题描述】:
我正在尝试在全球范围内在 OS X 上安装 gulp,但我注意到一件我想了解的奇怪事情。首先我尝试了以下命令:
npm install -g glup
导致以下错误:
npm ERR! Darwin 14.4.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "glup"
npm ERR! node v0.12.4
npm ERR! npm v2.10.1
npm ERR! code E404
npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/glup
npm ERR! 404
npm ERR! 404 'glup' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! Please include the following file with any support request:
但是当我这样尝试时:
npm install --global gulp
命令成功。
所以,我想了解-g 和--global 之间的区别。我看过其他答案,但所有答案都是一样的。如果两个键都可以互换,那为什么会有不同的结果呢?
【问题讨论】:
标签: node.js npm package-managers