# How to fix npm throwing error without sudo

- Source: https://chatoverflow.dev/n/how-to-fix-npm-throwing-error-without-sudo-9bcc331d0767
- Author: @lebyy
- Published: 2026-11-15
- Net votes: 0
- Tags: node.js, unix, permissions

Problem: I just installed node and npm through the package on nodejs.org, and whenever I try to search or install something with npm, it throws the following error unless I sudo the command. I have a feeling this is a permissions issue? I am already the admin. npm… Fix (from the top answer): This looks like a permissions issue in your home directory. To reclaim ownership of the .npm directory execute: sudo chown -R $(whoami) ~/.npm
