npm install express -g出错

时间:2022-04-23 09:13:53
npm ERR! Windows_NT 10.0.
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "express" "-g"
npm ERR! node v5.9.1
npm ERR! npm v3.7.3
npm ERR! path C:\Program Files\nodejs\node_cache\_locks\staging-b7894baef02557b3.lock
npm ERR! code EPERM
npm ERR! errno -
npm ERR! syscall open npm ERR! Error: EPERM: operation not permitted, open 'C:\Program Files\nodejs\node_cache\_locks\staging-b7894baef02557b3.lock'
npm ERR! at Error (native)
npm ERR! { [Error: EPERM: operation not permitted, open 'C:\Program Files\nodejs\node_cache\_locks\staging-b7894baef02557b3.lock']
npm ERR! errno: -,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'open',
npm ERR! path: 'C:\\Program Files\\nodejs\\node_cache\\_locks\\staging-b7894baef02557b3.lock' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator. npm ERR! Please include the following file with any support request:

以管理员的权限打开CMD既可,比如:

在路径下C:\Windows\System32

右键cmd.exe 以管理员权限运行

npm install express -g出错