bower的權限問題


裝bootstrap的時候,先用sudo指令裝了bower,但是一打 bower isntall bootstrap 就報錯:

Error: EACCES, permission denied '/Users/narumi/.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>:289:15)

    at Object.create.all.get (/usr/local/lib/node_modules/bower/node_modules/configstore/index.js:34:29)

    at Object.Configstore (/usr/local/lib/node_modules/bower/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?然並luan。

bower ESUDO         Cannot be run with sudo

借鑒了stackOverflow上面達人的回答,先chown

 sudo chown -R $USER ~/.config/configstore/

然后再 bower install bootstrap 會提示

May bower anonymously report usage statistics to improve the tool over time? 敲個Y or N,回車

然搞定:

bower not-cached    git://github.com/twbs/bootstrap.git#*

bower resolve       git://github.com/twbs/bootstrap.git#*

bower download      https://github.com/twbs/bootstrap/archive/v3.3.6.tar.gz

bower progress      bootstrap#* received 0.9MB of 3.8MB downloaded, 24%

bower progress      bootstrap#* received 0.9MB of 3.8MB downloaded, 24%

bower progress      bootstrap#* received 0.9MB of 3.8MB downloaded, 25%

bower progress      bootstrap#* received 1.0MB of 3.8MB downloaded, 25%

bower progress      bootstrap#* received 1.0MB of 3.8MB downloaded, 26%

bower progress      bootstrap#* received 1.0MB of 3.8MB downloaded, 27%

bower progress      bootstrap#* received 1.0MB of 3.8MB downloaded, 27%

bower progress      bootstrap#* received 1.1MB of 3.8MB downloaded, 28%

bower progress      bootstrap#* received 1.1MB of 3.8MB downloaded, 30%

bower progress      bootstrap#* received 1.2MB of 3.8MB downloaded, 32%

bower progress      bootstrap#* received 1.4MB of 3.8MB downloaded, 36%

bower progress      bootstrap#* received 1.6MB of 3.8MB downloaded, 41%

bower progress      bootstrap#* received 1.9MB of 3.8MB downloaded, 49%

bower progress      bootstrap#* received 2.3MB of 3.8MB downloaded, 60%

bower progress      bootstrap#* received 2.8MB of 3.8MB downloaded, 72%

bower progress      bootstrap#* received 3.2MB of 3.8MB downloaded, 83%

bower progress      bootstrap#* received 3.5MB of 3.8MB downloaded, 92%

bower progress      bootstrap#* received 3.6MB of 3.8MB downloaded, 95%

bower progress      bootstrap#* received 3.8MB of 3.8MB downloaded, 99%

bower extract       bootstrap#* archive.tar.gz

bower resolved      git://github.com/twbs/bootstrap.git#3.3.6

bower not-cached    git://github.com/jquery/jquery-dist.git#1.9.1 - 2

bower resolve       git://github.com/jquery/jquery-dist.git#1.9.1 - 2

bower download      https://github.com/jquery/jquery-dist/archive/2.2.0.tar.gz

bower extract       jquery#1.9.1 - 2 archive.tar.gz

bower resolved      git://github.com/jquery/jquery-dist.git#2.2.0

bower install       bootstrap#3.3.6

bower install       jquery#2.2.0

延伸閱讀 每天一個linux命令(30): chown命令


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM