. Advertisement .
..3..
. Advertisement .
..4..
When I running npm commands, I get the error ”npm err! please try running this command again as root/administrator.”
npm ERR! Error: EACCES: permission denied, open 'npm-debug.log.3300950547'
npm ERR! at Error (native)
npm ERR! {[Error: EACCES: permission denied, open 'npm-debug.log.3300950547']
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'open',
npm ERR! path: 'npm-debug.log.3300950547' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/nsebhastian/Desktop/DEV/learn-node/npm-debug.log
I don’t know why this error happens and how to fix it?
Can you help me?
Thanks!
The cause: I think this error happens when you don’t have authorization to access or alter directories inside your Node project.
Solution: To solve this issue, you should try running the command as an administrator as a first step.
You can add the
sudo
command before yournpm
command on macOS or Linux as shown below:If you’re a Windows user, run the Command Prompt or PowerShell as Administrator.