Ionic-cli: Error: EACCES: permission denied, rmdir 'build'

Created on 9 May 2018  路  4Comments  路  Source: ionic-team/ionic-cli

npm i -g ionic@latest

or

sudo npm i -g ionic@latest

if i run command, catch some error, like this:
image
how to resolve it?

triage

Most helpful comment

@smallg You're getting permission errors for /usr/local/lib/node_modules. This is not an ionic issue, but an issue with your npm setup. See the npm docs: https://docs.npmjs.com/getting-started/fixing-npm-permissions

You can also do the following:

sudo chown -R $(whoami):staff /usr/local/lib/node_modules

This will change the directory owner to be your personal account. Then, never use sudo with npm.

All 4 comments

@smallg You're getting permission errors for /usr/local/lib/node_modules. This is not an ionic issue, but an issue with your npm setup. See the npm docs: https://docs.npmjs.com/getting-started/fixing-npm-permissions

You can also do the following:

sudo chown -R $(whoami):staff /usr/local/lib/node_modules

This will change the directory owner to be your personal account. Then, never use sudo with npm.

@dwieeb it works for me, thanks.

i can't create project in ionic 4.Some errors are occurred. I can't understand is anyone can help me..?
error

please help me...

@MiluMaria Please create new issues. That's not the same issue. Also, your CLI is out of date.

Was this page helpful?
0 / 5 - 0 ratings