bower install 报错

bower install 报错

bower install在执行的时候,总是EACCESS错误;

Stack trace:
Error: EACCES, rename '/var/folders/3b/0jd32f912h11193j_6gz4d700000gn/T/$user/bower/google-code-prettify-5938-0i0ZUC'
    at Error (native)

Console trace:
Trace
    at StandardRenderer.error (/usr/local/lib/node_modules/bower/lib/renderers/StandardRenderer.js:82:17)
    at Logger. (/usr/local/lib/node_modules/bower/bin/bower:110:22)
    at Logger.emit (events.js:107:17)
    at Logger.emit (/usr/local/lib/node_modules/bower/node_modules/bower-logger/lib/Logger.js:29:39)
    at /usr/local/lib/node_modules/bower/lib/commands/index.js:40:20
    at _rejected (/usr/local/lib/node_modules/bower/node_modules/q/q.js:797:24)
    at /usr/local/lib/node_modules/bower/node_modules/q/q.js:823:30
    at Promise.when (/usr/local/lib/node_modules/bower/node_modules/q/q.js:1035:31)
    at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/bower/node_modules/q/q.js:741:41)
    at /usr/local/lib/node_modules/bower/node_modules/q/q.js:557:44

解决方法

sudo bower install –allow-root
sudo chown -R $USER bower_components

第一条语句,强制以root执行;然后再把bower的依赖项全部变更为当前用户;

你可能感兴趣的:(bower install 报错)