【发布时间】:2021-06-18 06:54:59
【问题描述】:
今天我通过卸载旧版本更新了node版本。我安装的最新版本是 4.5.0 LTS。安装后,当我尝试安装新的 npm 时,它不起作用并给我以下错误
C:\Users\myuser
λ npm install -g yo
npm ERR! Windows_NT 10.0.10240
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "yo"
npm ERR! node v0.12.15
npm ERR! npm v2.15.1
npm ERR! code EACCES
npm ERR! errno EACCES
npm ERR! syscall connect
npm ERR! Error: connect EACCES
npm ERR! at exports._errnoException (util.js:746:11)
npm ERR! at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1012:19)
npm ERR! { [Error: connect EACCES] code: 'EACCES', errno: 'EACCES', syscall: 'connect' }
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! C:\Users\myuser\npm-debug.log
我已经在 Powershell 中使用具有管理员权限的命令行进行了尝试。还尝试安装其他几个插件。没有任何效果。还关掉了防火墙试了试,还是不行。安装了旧版本的 NodeJS,问题仍然存在。
我使用的是 Windows 10。我检查了我是否在代理后面,但我不是。
【问题讨论】:
-
@YanFoto 感谢您的评论,但我试过了,不行
标签: node.js powershell npm npm-install