Bogdan Polovko Bogdan Polovko - 5 months ago 42
Node.js Question

bower EACCES error, permision denied

I've run ito this problem, while installing bootstrap. Any suggestions?

bower not-cached https://github.com/twbs/bootstrap.git#*
bower resolve https://github.com/twbs/bootstrap.git#*
bower checkout bootstrap#v3.3.6
bower EACCES EACCES: permission denied, open '/Users/criticus/.cache/bower/packages/478ab1d28ba78f550601bf536eea62f5-3.3.6.lock'

Stack trace:
Error: EACCES: permission denied, open '/Users/criticus/.cache/bower/packages/478ab1d28ba78f550601bf536eea62f5-3.3.6.lock'
at Error (native)

Console trace:
Error
at StandardRenderer.error (/Users/criticus/NPM/lib/node_modules/bower/lib/renderers/StandardRenderer.js:81:37)
at Logger. (/Users/criticus/NPM/lib/node_modules/bower/lib/bin/bower.js:110:26)
at emitOne (events.js:77:13)
at Logger.emit (events.js:169:7)
at Logger.emit (/Users/criticus/NPM/lib/node_modules/bower/lib/node_modules/bower-logger/lib/Logger.js:29:39)
at /Users/criticus/NPM/lib/node_modules/bower/lib/commands/index.js:48:20
at _rejected (/Users/criticus/NPM/lib/node_modules/bower/lib/node_modules/q/q.js:844:24)
at /Users/criticus/NPM/lib/node_modules/bower/lib/node_modules/q/q.js:870:30
at Promise.when (/Users/criticus/NPM/lib/node_modules/bower/lib/node_modules/q/q.js:1122:31)
at Promise.promise.promiseDispatch (/Users/criticus/NPM/lib/node_modules/bower/lib/node_modules/q/q.js:788:41)
System info:
Bower version: 1.7.9
Node version: 4.4.7
OS: Darwin 15.5.0 x64

I've tried

sudo bower install --allow-root
sudo chown -R $USER:$GROUP ~/.npm
sudo chown -R $USER:$GROUP ~/.config


and nothing of these helped.

Help really appreciated! Thanks

Answer

Try deleting your bower cache:

sudo rm -r ~/.cache/bower