# `npm error code EACCES: permission denied, mkdir '/usr/local/lib/node_modules/...'`

**Where it appears:** Terminal

**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 -g` globally when a local project install or `npx` should be used.
- A folder inside your project was created with administrator (`sudo`) permissions earlier.

## Message for your agent

```text
npm failed with EACCES permission denied. Don't use sudo: install the package inside the project or run the tool with npx instead.
```

**Prevention:** Use `npx` for one-off tools and install packages locally in the project without `sudo`.

---
Source: [Agentic Makers](https://agenticmakers.app/en/help/errors/eacces-permission-denied-npm) · License: CC BY 4.0
