使用Bower安装时出现权限错误 [英] Getting a permission error when installing with bower

查看:85
本文介绍了使用Bower安装时出现权限错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Everytime I try to install something with Bower I get a permission error like this:

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.预先感谢.

I imagine there might be an easy solution to this. But this is my first experience with Bower. Thanks in advance.

推荐答案

尝试了sudo吗?

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

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

Another solution is to change the chown of your configstore folder

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

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

If there are more errors with eaccess, expand the chown to your whole home folder

这篇关于使用Bower安装时出现权限错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆