Terminal
npm error code EACCES: permission denied, mkdir '/usr/local/lib/node_modules/...'
- What it means
- A command tried to install a package into a protected system folder instead of inside your project.
- Likely causes
- Running
npm install -gglobally when a local project install ornpxshould be used. - A folder inside your project was created with administrator (
sudo) permissions earlier.
- Running
- Prevention
- Use
npxfor one-off tools and install packages locally in the project withoutsudo.
Copy for your agent
npm failed with EACCES permission denied. Don't use sudo: install the package inside the project or run the tool with npx instead.
Was this page helpful?