2017-12-27 986 views
0

剛剛重新安裝了我的ubuntu,並且安裝了必要的東西,如nodejs npm。如果我克隆項目,並試圖sudo npm install我得到了這個錯誤。有人有同樣的問題?權限被拒絕npm install的錯誤

使用 節點:8.9.3 NPM:5.5.1

fetchPackageMetaData error for [email protected]://github.com/gulpjs/gulp.git#4ed9a4a3275559c73a396eff7e1fde3824951ebb Command failed: /usr/bin/git clone -q git://github.com/gulpjs/gulp.git /home/user_name/.npm/_cacache/tmp/git-clone-0e191fc9 

fetchPackageMetaData /home/user_name/.npm/_cacache/tmp/git-clone-0e191fc9/.git: Permission denied 

Error: Command failed: /usr/bin/git clone -q git://github.com/gulpjs/gulp.git /home/user_name/.npm/_cacache/tmp/git-clone-0e191fc9 

/home/user_name/.npm/_cacache/tmp/git-clone-0e191fc9/.git: Permission denied 
+0

https://stackoverflow.com/questions/31744852/npm-install-giving-error-while-accessing-git-url這個問題可能有幫助。 – evolutionxbox

+0

npm與安裝節點一起安裝...我避免使用sudo ...如果使用sudo安裝節點,則所有npm install命令也必須發出sudo ...如果您在安裝過程中避免使用sudo,請不要使用'sudo npm安裝x' ...安裝沒有sudo可以是原始代碼安裝或編譯安裝...閱讀內嵌評論\t https://askubuntu.com/questions/426750/how-can-i-update-my -nodejs到了,最新版本/ 959382#959382 –

回答

0

安裝節點沒有sudo和你不會得到拒絕 「權限錯誤」。

sudo npm install node

使用此命令:

npm install node