Symptom: A global npm install ends with EACCES, meaning the terminal could not write to the target location.
Fastest safe response: npm’s official guide gives two main directions: use a Node.js version manager or move the global install directory into your user account. First check where Node.js and npm are running from. Don’t force the install with sudo or change system-folder permissions before you know the cause. (npm’s EACCES guide)
Who this is for: Students who installed Node.js 24 on a Mac and hit a permissions error on their first global npm command.
It’s also for learners on school-managed or remote Macs who don’t have administrator access.
If your project runs but a course tool is missing, you’ll learn how to check whether that’s a global-command problem or a project-dependency problem.
SECTION 01First separate project packages from global commands
The word “install” can describe two different tasks. Before troubleshooting EACCES, look at the command you ran and where the error points.
A project dependency is a tool or library that belongs to one project. Think of it as a set of supplies kept in that project’s own folder. A global package is more like a shared tool you want to call from different folders. You may see the term “global install” for a package installed with npm’s global option. npm explains the distinction in its guide to installing packages globally.
That distinction matters because an error during a project install does not automatically mean your global npm directory has a permissions problem.
Did npm install fail while setting up your project? Start in the project folder and read the first error that names a package or directory. Check that you’re in the folder containing the project’s package file, then follow the project’s setup instructions. Don’t change your global directory just because an install failed.
Did you run a global command and get EACCES? For example, if you used npm’s global option and the error names a directory that npm uses for global packages, inspect the Node.js and npm paths before choosing a fix. The error means a write was denied at the named location; by itself, it doesn’t tell you whether the cause is an old installation, mixed paths, or a directory you can’t write to.
Check the exact command you entered and the full error text. A course may ask you to run a tool inside a project, while a tutorial may ask you to install a shared command. If the course expects a project-local tool, prefer the course’s instructions over installing a different copy globally.
SECTION 02Read the paths before changing anything
Your terminal finds programs by searching a list of locations called PATH. You can think of it as a route map: when you type node or npm, the shell uses the first matching program it finds. If the two commands come from different installations, changing one directory may not fix the other.
Run these checks in the same terminal where the error occurred:
node --version
npm --version
command -v node
command -v npm
npm config get prefix
npm root -g
The version commands tell you what responds, while the path checks show which executables and global package locations your shell is using. npm’s documentation describes its global folders and folder locations. Compare the output rather than assuming every command belongs to the same installation.
- If
command -v nodeandcommand -v npmpoint to different installation areas, your shell may be mixing installations. - If both commands come from the same installation but
npm config get prefixnames a protected system location, the global target may not be writable for your account. - If the paths look unfamiliar or you see a leftover installation location, don’t delete it based on the path alone. First check the installation instructions for your course or the method used to set up Node.js.
Where does a Node.js 24 npm permission error usually come from? Usually, npm is trying to write to a global location that your current account cannot change, or your terminal is using a different Node.js/npm installation than you expect. The error identifies a denied write, not a safe command to run next. Use the output above to identify the relevant paths before changing your setup.
If your course requires Node.js 24, verify that the node --version output matches the course requirement before changing installation methods. The Node.js 24 download archive lists the releases in that major version. For release status, check the official Node.js release page rather than relying on an old tutorial. A version manager can make switching versions easier, but don’t move your course environment to another setup until you know which version the course expects.
SECTION 03Choose a repair that matches the machine
npm’s EACCES guidance recommends using a Node.js version manager as one way to avoid global installations that require administrator-level writes. Another route is to configure npm to use a directory in your user account. These are alternatives, not a promise that one fix works with every installation. (npm’s EACCES guidance)
A Node.js version manager is a way to manage multiple Node.js versions for different courses or projects. It can be a good fit when you need to switch versions and are allowed to install and configure your own tools. Before adopting one, check the course’s required version and the manager’s current setup instructions. Avoid mixing it with an existing installation until you understand which node and npm your terminal will use afterward.
Changing npm’s global install directory to a user-owned location can suit a learner who wants to keep the existing Node.js installation. npm documents the global directory and configuration options. This route also requires your shell to find commands installed there. The exact change depends on your setup, so follow npm’s current instructions and check how they apply to your shell before editing its configuration.
If your Mac is managed by a school and you can’t edit the required settings, stop and ask the administrator or course support team. Don’t try to work around device restrictions. You can still use project-local dependencies when the course permits them, or ask whether an approved development environment is available.
Decision conditions
- If you need several Node.js versions for separate classes, and you’re allowed to manage your own tools: choose a version-manager route. Check the course version first, then verify which Node.js and npm your shell uses after setup.
- If you want to keep your current Node.js installation and only need your global packages in a writable location: consider an npm user-directory configuration. Follow the official instructions for your shell, including the required
PATHupdate. - If the device is school-managed, the relevant configuration is locked, or the paths are unclear: stop. Ask the administrator or course support team rather than changing system permissions.
- If the failure is for a project dependency rather than a global command: return to the project’s setup instructions. A global-directory change may not address the problem.
Can you install a global npm command without administrator access? Often, yes, if your installation method and device policy allow a user-owned setup. A version manager or a user-directory configuration can avoid writing to a protected system location. On a managed Mac, your school’s rules still apply; don’t treat a permissions error as permission to bypass them.
SECTION 04Verify the fix without disturbing coursework
After you make an approved change, open a fresh terminal session and repeat the path checks. A configuration edit may not affect a terminal that was already open. Compare the new output with the previous output and make sure the Node.js version still matches the course requirement.
Then test the command you intended to install. First check whether npm reports a successful install. Next, try the installed command from the location and in the way its documentation specifies. If the install succeeds but the shell says the command can’t be found, check whether the directory for global executables is included in your PATH. npm’s configuration documentation explains the available settings; don’t guess at paths or copy a shell configuration line from an unrelated setup.
Also check the course project separately. From its folder, run the project’s documented setup or test command. If it still works, that gives you a direct check that the change did not break the coursework environment. If you work in an editor with an integrated terminal, confirm that it uses the same shell environment as your regular terminal. The editor may load a different shell profile or environment; its terminal settings can help you inspect that behavior.
How can you check that your course project is still safe? Confirm that the project is using its required Node.js version, run its documented command, and check that any project-local dependencies remain available. Don’t remove the project’s package files or reinstall its dependencies just to verify a global command.
Stop changing settings if permission is still denied, the new command is missing, or the path output is confusing. Record the command you ran, the full error, and the outputs of the path checks. That gives an administrator or course helper enough context to diagnose the issue without asking you to make riskier changes.
| What you observe | Likely issue to check | Safer next action |
|---|---|---|
A global install reports EACCES for a protected location |
npm may be targeting a directory your account cannot write to | Compare the npm prefix with the executable paths; consider an approved user-owned setup |
node and npm resolve to different locations |
Your shell may be mixing installations | Check the course setup instructions and shell configuration before switching methods |
| Install succeeds but the command is not found | The global executable directory may not be on PATH |
Check the configured prefix and shell search path |
| A project dependency install fails | The failure may be local to the project rather than the global directory | Follow the project’s own setup instructions and inspect the first relevant error |
| A school device blocks the change | The device may have administrator controls | Stop and ask the school’s administrator or course support |
| Route | Best fit | Trade-off to consider |
|---|---|---|
| Use a Node.js version manager | You need to switch Node.js versions for different classes or projects | You must verify which version your shell uses and avoid mixing installations |
| Configure a user-owned npm directory | You want to keep the existing Node.js setup and need writable global packages | You must configure the shell search path correctly |
| Use project-local tools where the course supports them | The required tool belongs to one project | A project-local tool may not provide a command shared across unrelated folders |
| Ask an administrator for help | Your Mac is managed or you cannot safely identify the paths | You may need approval before changing the environment |
If your current computer cannot provide a usable Mac environment for a course, first decide whether you actually need macOS for the work. A Windows or Linux machine can be perfectly suitable for many JavaScript exercises, but it won’t resolve a course requirement that specifically depends on macOS. A school-managed Mac can also be a good choice if it already has the tools and permissions you need.
Buying a Mac can make sense if you expect to use it regularly and need a stable local setup. It also means paying for hardware and maintaining it, even when you only need a Mac environment for a short assignment. A remote Mac avoids that purchase, but depends on a reliable internet connection and may not suit tasks that need a physical device connected to your computer.
If you need a Mac only for course exercises, review the MACNOX Mac access options and available plans before deciding. Renting is worth considering when you need a temporary, real macOS environment and don’t want to buy hardware just to troubleshoot a course setup. It isn’t the right choice if you need a permanently available local machine, have restricted network access, or must connect physical devices. For a temporary study environment, you can check MACNOX access options and compare them with your school’s approved resources.