我在尝试安装mobify客户端时遇到此错误。我的node.js版本是:0.8.6和npm:1.1.48。另外我在代理后面,在第一行我只是设置代理,但我不知道这个行为和设置http_proxy变量一样吗?
C:\Users\user>npm config set proxy http://user:pass@proxy:port
C:\Users\user>npm -g install mobify-client
npm http GET https://registry.npmjs.org/mobify-client
npm http GET https://registry.npmjs.org/mobify-client
npm http GET https://registry.npmjs.org/mobify-client
npm http GET https://registry.npmjs.org/-/mobify-client-0.3.8.tgz
npm ERR! fetch failed https://registry.npmjs.org/-/mobify-client-0.3.8.tgz
npm http GET https://registry.npmjs.org/-/mobify-client-0.3.8.tgz
npm ERR! fetch failed https://registry.npmjs.org/-/mobify-client-0.3.8.tgz
npm http GET https://registry.npmjs.org/-/mobify-client-0.3.8.tgz
npm ERR! fetch failed https://registry.npmjs.org/-/mobify-client-0.3.8.tgz
npm ERR! Error: SSL Error: Hostname/IP doesn't match certificate's altnames
npm ERR! at ClientRequest.<anonymous> (C:\Program Files (x86)\nodejs\node_mo
dules\npm\node_modules\request\main.js:440:26)
npm ERR! at ClientRequest.g (events.js:185:14)
npm ERR! at ClientRequest.EventEmitter.emit (events.js:88:17)
npm ERR! at HTTPParser.parserOnIncomingClient (http.js:1455:7)
npm ERR! at HTTPParser.parserOnHeadersComplete [as onHeadersComplete] (http.js:111:23)
npm ERR! at CleartextStream.socketOnData (http.js:1366:20)
npm ERR! at CleartextStream.CryptoStream._push (tls.js:485:27)
npm ERR! at SecurePair.cycle (tls.js:839:20)
npm ERR! at EncryptedStream.CryptoStream.write (tls.js:220:13)
npm ERR! at Socket.ondata (stream.js:38:26)
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-@googlegroups.com>
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "-g" "install" "mobify-client"
npm ERR! cwd C:\Users\user
npm ERR! node -v v0.8.6
npm ERR! npm -v 1.1.48
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\Users\user\npm-debug.log
npm ERR! not ok code 0
答案 0 :(得分:1)
这里好像有两个潜在的问题。一个是npm服务器当时可能有一些问题,你可能想现在再试一次,看看你是否得到了同样的错误。在我们的支持论坛中提出了同样的问题(甚至可能已经被你问过:))而另一位用户说再次尝试修复了这个问题:
https://support.mobify.com/customer/portal/questions/445465-installation-error
另一个问题是您可能在代理后面,无法连接到npm服务器。您可以使用以下命令设置代理位置:
npm config set proxy http://url:port
或者,如果代理经过身份验证:
npm config set proxy http://user:pass@url:port