通过npm安装bower后,请安装-g bower 并更新它。这就是我得到的。尝试安装jquery或任何软件包时。我在MacOS上。
Stack trace:
Error: EACCES: permission denied, unlink '/Users/ericheng/.cache/bower/registry/registry.bower.io/lookup/jquery_d223e'
Console trace:
Error
at StandardRenderer.error (/usr/local/lib/node_modules/bower/lib/renderers/StandardRenderer.js:88:37)
at Logger.<anonymous> (/usr/local/lib/node_modules/bower/lib/bin/bower.js:113:30)
at Logger.emit (events.js:197:13)
at Logger.emit (/usr/local/lib/node_modules/bower/lib/node_modules/bower-logger/lib/Logger.js:29:39)
at /usr/local/lib/node_modules/bower/lib/commands/index.js:49:24
at _rejected (/usr/local/lib/node_modules/bower/lib/node_modules/q/q.js:864:24)
at /usr/local/lib/node_modules/bower/lib/node_modules/q/q.js:890:30
at Promise.when (/usr/local/lib/node_modules/bower/lib/node_modules/q/q.js:1142:31)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/bower/lib/node_modules/q/q.js:808:41)
at /usr/local/lib/node_modules/bower/lib/node_modules/q/q.js:624:44
System info:
Bower version: 1.8.4
Node version: 11.9.0
OS: Darwin 18.0.0 x64
答案 0 :(得分:-1)
最后我就这样跑了 sudo bower install --allow-root 只是不确定如何在没有sudo的情况下不这样做。与我有关的某些文件没有适当的权限