2016-11-08 80 views
2

我想安裝量角器但接收到以下錯誤。 命令: npm install -g protractor量角器錯誤 - @ types/jasmine'不在npm註冊表中

npm ERR! node v4.4.3 
npm ERR! npm v2.15.1 
npm ERR! code E404 

npm ERR! 404 no such package available : @types/jasmine 
npm ERR! 404 
npm ERR! 404 '@types/jasmine' 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 'protractor' 
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!  F:\temp\chrome downloads\npm-debug.log 
+0

您可能需要安裝最新版本的nodejs。你可以嘗試最新的一個 –

+0

我安裝了最新版本7.0.0。但仍然看到相同的問題 – Ankit

+0

你安裝nodejs後運行npm install嗎?如果不是,請做它 –

回答

4

我碰到這個問題,今天來了,我的問題是,我已經設置了NPM配置文件中的自定義註冊表。你有沒有使用過「npm set registry」? 如果是這樣,你可以手動告訴NPM哪裏去尋找「@types」使用下面的命令註冊表:

NPM配置集@types:註冊表https://registry.npmjs.org/

1

問題是一個事實,即你」來重新使用尚未添加對@organization軟件包的支持的私有註冊表。 在我的情況下,我使用Sonatype Nexus,我的版本不支持這些類型的包。 @Willie Valdez的建議可能是您現在最好的解決方案。

此外,請檢查您的主目錄或項目目錄中是否有.npmrc文件。註冊表可能在那裏。如果是這樣的話,只需將文件重命名爲npmrc_bak或其他東西,直到您安裝軟件包,然後恢復爲其原始名稱。