簡體   English   中英

Ubuntu:錯誤:EACCES,使用bower安裝時權限被拒絕錯誤

[英]Ubuntu: Error: EACCES, permission denied error while using bower to install

我正在使用以下命令安裝bower ...

sudo npm install -g bower

並獲得以下內容...

npm http GET https://registry.npmjs.org/bower
npm http 304 https://registry.npmjs.org/bower
/usr/local/bin/bower -> /usr/local/lib/node_modules/bower/bin/bower
bower@1.7.7 /usr/local/lib/node_modules/bower

我相信Bower已使用NPM成功安裝。

然后,我運行以下命令安裝Angular計時器...

bower install angular-timer

並獲得以下錯誤處理回溯...

Error: EACCES, permission denied '/home/alopex/.config/configstore/bower-github.yml'
You don't have access to this file.

at Object.fs.openSync (evalmachine.<anonymous>:432:18)
at Object.fs.readFileSync (evalmachine.<anonymous>:286:15)
at Object.create.all.get (/usr/local/lib/node_modules/bower/lib/node_modules/configstore/index.js:34:29)
at Object.Configstore (/usr/local/lib/node_modules/bower/lib/node_modules/configstore/index.js:27:44)
at readCachedConfig (/usr/local/lib/node_modules/bower/lib/config.js:19:23)
at defaultConfig (/usr/local/lib/node_modules/bower/lib/config.js:11:12)
at Object.<anonymous> (/usr/local/lib/node_modules/bower/lib/index.js:16:32)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)

我會嘗試僅使用sudo ,但是我從Stack Overflow和Bower站點周圍了解到,Bower並不是使用sudo運行的。 我該如何解決這一困境?

首先執行以下操作。

 sudo bower install --allow-root

然后在終端中運行以下命令

 bower install

即使成功安裝了bower.json文件中包含的所有軟件包,有時也會顯示錯誤。

通常,Bower本地安裝在您的項目目錄中,不需要root訪問。

干杯!

暫無
暫無

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

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