【问题标题】:ubuntu bower command, Error: EACCES, permission denied '.../insight-bower.json'ubuntu bower 命令,错误:EACCES,权限被拒绝'.../insight-bower.json'
【发布时间】:2015-12-23 23:47:15
【问题描述】:

我无法以用户身份运行 bower 命令,运行 bower 时出现以下错误:

错误:EACCES,权限被拒绝 '/home/***/.config/configstore/insight-bower.json' 您无权访问此文件。

at Object.fs.openSync (fs.js:432:18)
at Object.fs.readFileSync (fs.js:286:15)
at Object.create.all.get (/usr/local/lib/node_modules/bower/node_modules/insight/node_modules/configstore/index.js:27:26)
at Object.Configstore (/usr/local/lib/node_modules/bower/node_modules/insight/node_modules/configstore/index.js:20:44)
at new Insight (/usr/local/lib/node_modules/bower/node_modules/insight/lib/index.js:37:34)
at ensureInsight (/usr/local/lib/node_modules/bower/lib/util/analytics.js:25:19)
at Object.setup (/usr/local/lib/node_modules/bower/lib/util/analytics.js:41:9)
at Object.<anonymous> (/usr/local/lib/node_modules/bower/bin/bower:72:11)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)

但是当我以 root 身份运行 bower 时,它工作正常。

怎么了?它以前工作正常,但是由于我执行了以下命令,它就出错了。

sudo bower cache clean --allow-root

【问题讨论】:

    标签: ubuntu bower


    【解决方案1】:

    问题是文件的所有者。 因为文件 '/home/***/.config/configstore/insight-bower.json' 的所有者是 root,所以我可以使用 sudo 和 --allow-root 运行 bower。

    所以问题很容易通过将所有者更改为我自己解决,如下所示:

    sudo chown bobsilon .config/configstore/insight-bower.json
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-10-01
      • 2016-11-14
      • 1970-01-01
      • 1970-01-01
      • 2021-07-22
      • 2018-03-08
      • 2019-10-28
      相关资源
      最近更新 更多