gpt4 book ai didi

permissions - 使用Bower安装时出现权限错误

转载 作者:行者123 更新时间:2023-12-03 13:38:51 25 4
gpt4 key购买 nike

每次我尝试使用Bower安装某些东西时,都会出现如下所示的权限错误:

Andreass-MacBook-Air:openMedia Andreas$ bower install jquery
/usr/local/lib/node_modules/bower/node_modules/configstore/index.js:56
throw err;
^
Error: EACCES, permission denied '/Users/Andreas/.config/configstore/bower-github.yml'
You don't have access to this file.

at Error (native)
at Object.fs.openSync (evalmachine.<anonymous>:500:18)
at Object.fs.readFileSync (evalmachine.<anonymous>:352: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:22:23)
at defaultConfig (/usr/local/lib/node_modules/bower/lib/config.js:11:24)
at Object.<anonymous> (/usr/local/lib/node_modules/bower/lib/index.js:40:32)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
Andreass-MacBook-Air:openMedia Andreas$


我想可能会有一个简单的解决方案。但这是我第一次接触Bower。提前致谢。

最佳答案

尝试过sudo吗?

sudo bower install --allow-root
sudo bower install jquery


另一个解决方案是更改configstore文件夹的文件夹

sudo chown -R Andreas:Andreas /Users/Andreas/.config/configstore/
bower init
bower install jquery


如果eaccess出现更多错误,请将chown扩展到整个主文件夹

关于permissions - 使用Bower安装时出现权限错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29865913/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com