EACCES:许可被拒绝,开放

时间:2016-09-20 16:42:47

标签: json node.js

bower EACCES        EACCES: permission denied, open '/home/caner/.cache/bower/packages/e5ec1b46386aa59c822f27e340f7ab5b-1.5.8.lock'

Stack trace:
Error: EACCES: permission denied, open '/home/caner/.cache/bower/packages/e5ec1b46386aa59c822f27e340f7ab5b-1.5.8.lock'
    at Error (native)

Console trace:
Error
    at StandardRenderer.error (/home/caner/.npm-global/lib/node_modules/bower/lib/renderers/StandardRenderer.js:81:37)
    at Logger.<anonymous> (/home/caner/.npm-global/lib/node_modules/bower/lib/bin/bower.js:110:26)
    at emitOne (events.js:90:13)
    at Logger.emit (events.js:182:7)
    at Logger.emit (/home/caner/.npm-global/lib/node_modules/bower/lib/node_modules/bower-logger/lib/Logger.js:29:39)
    at /home/caner/.npm-global/lib/node_modules/bower/lib/commands/index.js:48:20
    at _rejected (/home/caner/.npm-global/lib/node_modules/bower/lib/node_modules/q/q.js:844:24)
    at /home/caner/.npm-global/lib/node_modules/bower/lib/node_modules/q/q.js:870:30
    at Promise.when (/home/caner/.npm-global/lib/node_modules/bower/lib/node_modules/q/q.js:1122:31)
    at Promise.promise.promiseDispatch (/home/caner/.npm-global/lib/node_modules/bower/lib/node_modules/q/q.js:788:41)
System info:
Bower version: 1.7.9
Node version: 5.12.0
OS: Linux 4.4.0-38-generic x64

当我尝试使用

安装bower时出现此错误
bower pdate
我试了很多东西。

bower init CHOWN

但没有效果

我首先安装了npm,然后尝试安装bower。

我做了大部分

https://www.google.com.tr/search?q=Error%3A+EACCES%3A+permission+denied%2C+open+%27%2F%2Fbower-github.json%27&oq=Error%3A+EACCES%3A+permission+denied%2C+open+%27%2F%2Fbower-github.json%27&aqs=chrome..69i57j69i58.3505j0j4&sourceid=chrome&ie=UTF-8

但没有工作。

可能是什么原因?

我想做的是

   npm install
npm install -g bower (no need if you have installed bower)
bower install
bower prune
bower update
npm install -g gulp (no need if you have installed gulp)
gulp install

在项目目录中

1 个答案:

答案 0 :(得分:1)

首先删除.cache文件夹,我猜这个.cache文件夹是使用不同的权限创建的,当你玩sudo等时会发生这种情况。

所以运行这个:

sudo rm -rf /home/caner/.cache

然后再次运行你的命令