【问题标题】:Unable to install TypeScript无法安装 TypeScript
【发布时间】:2017-01-09 02:13:25
【问题描述】:

我无法在节点版本 6.3.0 和 npm 版本 3.10.3 的 Windows 10 中安装 TypeScript。出现以下错误

33 error Windows_NT 10.0.10586
34 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "typescript"
35 error node v6.3.0
36 error npm  v3.10.3
37 error code ECONNREFUSED
38 error errno ECONNREFUSED
39 error syscall connect
40 error Error: connect ECONNREFUSED 151.101.8.162:443
40 error     at Object.exports._errnoException (util.js:1008:11)
40 error     at exports._exceptionWithHostPort (util.js:1031:20)
40 error     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1080:14)
40 error  { Error: connect ECONNREFUSED 151.101.8.162:443
40 error     at Object.exports._errnoException (util.js:1008:11)
40 error     at exports._exceptionWithHostPort (util.js:1031:20)
40 error     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1080:14)
40 error   code: 'ECONNREFUSED',
40 error   errno: 'ECONNREFUSED',
40 error   syscall: 'connect',
40 error   address: '151.101.8.162',
40 error   port: 443 }
41 error If you are behind a proxy, please make sure that the
41 error 'proxy' config is set properly.  See: 'npm help config'
42 verbose exit [ 1, true ]

【问题讨论】:

  • ECONNREFUSED 表示连接被拒绝;并且建议配置代理服务器“如果你在代理后面,请确保'proxy'配置设置正确。参见:'npm help config'”
  • 如何找到我的代理?
  • 这不是编程问题,您应该将问题移至超级用户。
  • 尝试运行“npm config set registry registry.npmjs.org

标签: node.js typescript windows-10


【解决方案1】:

对我来说,解决方案是像 Abhishek 在 cmets 中提到的那样设置注册表,但使用 https:// 所以:

npm set registry https://registry.npmjs.org/

如需更多帮助和其他解决方案,请查看issue 8293 on npm Github repository

【讨论】:

    猜你喜欢
    • 2020-08-04
    • 1970-01-01
    • 1970-01-01
    • 2017-06-11
    • 2018-12-09
    • 2017-10-10
    • 2019-04-22
    • 2019-06-17
    • 2021-07-26
    相关资源
    最近更新 更多