我正在使用 nvm 来管理我的节点版本。我有一个使用节点 6.10.2 的项目。使用像
npm install -g gulp
这样简单的东西,我收到以下错误:
write EPROTO 101057795:error:1408D07B:SSL routines:ssl3_get_key_exchange:bad signature:openssl\ssl\s3_clnt.c:20
我已将 strict-ssl false 添加到我的配置中,但这没有帮助。我没有在代理后面,我在我的公司防火墙、家庭网络甚至我的移动热点后面尝试过它,都出现相同的错误。我更改为使用 http:// 而不是 https:// 使用
npm config set registry http://registry.npmjs.org/
,这让我克服了 gulp 错误,但随后使用其他包时错误返回(大概是因为它们是从不同的注册表中提取的)。无论如何,使用 http:// 都会让我担心安全问题。
我在节点 6.10.2 和 7.4.0 上得到了相同的结果。如果我跳转到最新的节点 12.18.0,则不会发生错误,但我正在处理的项目不支持该新的节点版本。不知道还能尝试什么。
这是npm-debug.log文件的错误部分:
103 verbose stack Error: write EPROTO 101057795:error:1408D07B:SSL routines:ssl3_get_key_exchange:bad signature:openssl\ssl\s3_clnt.c:2032:
103 verbose stack
103 verbose stack at exports._errnoException (util.js:1018:11)
103 verbose stack at WriteWrap.afterWrite (net.js:804:14)
104 verbose cwd C:\code\extraspace.web.pointofsale
105 error Windows_NT 10.0.18363
106 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "gulp"
107 error node v6.10.2
108 error npm v3.10.10
109 error code EPROTO
110 error errno EPROTO
111 error syscall write
112 error write EPROTO 101057795:error:1408D07B:SSL routines:ssl3_get_key_exchange:bad signature:openssl\ssl\s3_clnt.c:2032:
免责声明:对 Nodejs 没有那么丰富的经验,我给出的答案是我自己对这个问题的研究,希望能在某种程度上帮助你。
参考资料: write-eproto-101057795... 或 通用代理和网络连接...
首先检查Nodejs是否安装正确
- Open Command Prompt (Windows) or Terminal (Mac) or Bash (Linux)
- Execute this command: node -v (The output should be "6.10.2")
- Execute this command: npm -v (The output should be "(some-version)")
试试这个:
- Open Command Prompt (Windows) or Terminal (Mac) or Bash (Linux)
- Go to the "app" folder (Located on the same folder of this file)
- Execute this command (*): npm install --development
- Execute this command: npm start --development
如果上述所有方法均失败,请检查下面的列表。
来自您的错误日志
...
...
107 error node v6.10.2
108 error npm v3.10.10
...
...
您的 npm 和 nodejs 版本非常旧。尝试升级npm和nodejs版本。
也试试
//disable strict ssl checking
npm config set strict-ssl false
//if you're using different npm registry try official registry for debug
npm config set registry https://registry.npmjs.org/