簡體   English   中英

npm命令鍵以全局安裝軟件包

[英]npm command key to install package globally

我正在嘗試在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之間的區別。 我看到了其他答案,但所有答案都是相同的。 如果兩個鍵可以互換,那么為什么會有不同的結果?

'glup'不在npm注冊表中。

你似乎已經輸入glup代替gulp ,並glup不存在的NPM。 這只是一個錯字。 -g--global之間應該沒有區別。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM