2017-02-28 40 views
1

我試圖從GitHub庫安裝包安裝包的NodeJS,但我得到以下信息:如何從GitHub庫

npm ERR! Darwin 15.6.0 
npm ERR! argv "/Users/z0019rb/.nvm/versions/node/v4.4.7/bin/node" "/Users/z0019rb/.nvm/versions/node/v4.4.7/bin/npm" "install" 
npm ERR! node v4.4.7 
npm ERR! npm v2.15.8 
npm ERR! code E404 

npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/target-digital-design-tokens 
npm ERR! 404 
npm ERR! 404 'target-digital-design-tokens' 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 It was specified as a dependency of 'target-base-pattern-library' 
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 ERR!  /Users/z0019rb/dev/design-systems/designsystems-site/npm-debug.log 

而這正是我的package.json的樣子:

"target-digital-design-tokens": "git+ssh://[email protected]:design-systems/design-tokens.git" 

不知道我做錯了。我試圖安裝的回購有一個package.json。謝謝!

+0

你是什麼命令使用g來安裝? package.json條目看起來很好。 – Alyss

+0

你只使用https嘗試過嗎?例如。 npm install https://git.target.com/design-systems/design-tokens.git 我認爲這是源代碼的一個問題,無法訪問 – John

+0

瘋狂猜測:嘗試使用'/'而不是':' 'git.target.com'之後? – Ryan

回答

0

試試這個:

"git+https://target.com/design-systems/design-tokens" 

,不要忘記設置git倉庫在你的package.json像這樣:

"repository": { 
    "type": "git", 
    "url": "[email protected]:design-systems/design-tokens.git" 
}, 

如果git的服務器位於代理不忘記設置env http_proxy之前npm install這樣的事情:

npm config set proxy "http://[email protected]:8080" 
npm config set https-proxy "http://[email protected]:8080" 
+0

這似乎並不奏效。有趣的是它曾經工作過,我沒有改變任何東西。 – jmdesigner81