【问题标题】:npm command key to install package globallynpm 命令键全局安装包
【发布时间】: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


    【解决方案1】:

    'glup' 不在 npm 注册表中。

    您似乎在 npm 上输入了 glup 而不是 gulpglup doesn't exist。这只是一个错字。 -g--global 应该没有区别。

    【讨论】:

      猜你喜欢
      • 2015-07-09
      • 2013-08-08
      • 2017-11-05
      • 2020-10-23
      • 1970-01-01
      • 2021-04-13
      • 1970-01-01
      • 2017-06-17
      • 1970-01-01
      相关资源
      最近更新 更多