Search code examples
node.jsubuntudowngrade

Permission denied when downgrading version node in Ubuntu


Im trying to downgrade node version with this command: npm install -g n but I have this error: [Error: EACCES: permission denied, unlink '/usr/local/bin/n']

Then, I have to use this command to downgrade: n 6.10.3

How can I fix the permission denied error?


Solution

  • Use sudo npm install -g n to run the command as a super user.