Node update error: checkpermissions missing write access to / usr / lib / node_ modules/n

Time:2021-7-24

Original address:https://www.wjcms.net/archives/node Error in updating module access permission

Node update error: checkpermissions missing write access to / usr / lib / node_ modules/n

Yesterday, I pushed the articles updated by node and NPM. Some friends wrote to me privately. There were errors in the update process, and the update was unsuccessful.

Today, I’ll send it again to solve this error reporting method.
The above error is caused by lack of permission, so add sudo before the command, or switch to root for operation.

The command is attached here:

Update NPM

Because NPM is foreign, the speed is slow, and failure is common. What’s the solution? Configure Taobao image (recommended)

sudo npm config set registry https://registry.npm.taobao.org

Run the command first to install the N module dependency package

sudo npm install n -g

After installation, you will be prompted for NPM update. Just run the prompted command directly

sudo npm install -g npm

Update node

Update the node version to the latest version of N latest and to the stable version of N stable

#Latest edition
sudo n latest
#Stable version
sudo n stable

关注我更多精彩

Recommended Today

VBS obtains the operating system and its version number

VBS obtains the operating system and its version number ? 1 2 3 4 5 6 7 8 9 10 11 12 ‘************************************** ‘*by r05e ‘* operating system and its version number ‘************************************** strComputer = “.” Set objWMIService = GetObject(“winmgmts:” _  & “{impersonationLevel=impersonate}!\\” & strComputer & “\root\cimv2”) Set colOperatingSystems = objWMIService.ExecQuery _  (“Select * from […]