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?

Upvotes: 1

Views: 541

Answers (1)

jasonandmonte
jasonandmonte

Reputation: 2028

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

Upvotes: 2

Related Questions