【问题标题】:Error when trying to install anything using npm尝试使用 npm 安装任何东西时出错
【发布时间】:2016-06-15 16:38:47
【问题描述】:

我正在通过 learnyounode 教程学习 node.js。有几次它要求我安装 bl、through2-map 等。每次我输入:npm install through2-map --save

它会运行几分钟然后抛出这个错误

 Linux 4.2.0-c9
npm ERR! argv "/home/ubuntu/.nvm/versions/node/v4.1.1/bin/node" "/home/ubuntu/.nvm/versions/node/v4.1.1/bin/npm" "install" "through2-map" "--save"
npm ERR! node v4.1.1
npm ERR! npm  v3.7.3
npm ERR! code ECONNREFUSED
npm ERR! errno ECONNREFUSED
npm ERR! syscall connect

npm ERR! Error: connect ECONNREFUSED 127.0.0.1:15443
npm ERR!     at Object.exports._errnoException (util.js:837:11)
npm ERR!     at exports._exceptionWithHostPort (util.js:860:20)
npm ERR!     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1060:14)
npm ERR!  { [Error: connect ECONNREFUSED 127.0.0.1:15443]
npm ERR!   code: 'ECONNREFUSED',
npm ERR!   errno: 'ECONNREFUSED',
npm ERR!   syscall: 'connect',
npm ERR!   address: '127.0.0.1',
npm ERR!   port: 15443 }
npm ERR! 
npm ERR! If you are behind a proxy, please make sure that the
npm ERR! 'proxy' config is set properly.  See: 'npm help config'

npm ERR! Please include the following file with any support request:
npm ERR!     /home/ubuntu/workspace/npm-debug.log

我尝试遵循这个 stackoverflow 建议 npm install not work 但这没有用。所以有人可以帮我解决如何设置我的 npm 以便我可以安装这些模块。谢谢。

【问题讨论】:

  • 你知道你是否需要使用代理服务器吗?这个question and its answers 展示了如何设置或删除代理设置。如果您不知道是否需要使用代理服务器,您可能不需要...并且应该删除该值并返回解决您遇到的原始问题。
  • 好的,感谢您提供的链接,我能够删除代理,我绝对不知道所以删除它是一个不错的选择,当我检查它时,它现在显示为 null。但是回到 npm install through2-map 我现在得到了上面的错误。

标签: node.js npm


【解决方案1】:

您的 NPM 注册表不再设置为 https://registry.npmjs.org

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

【讨论】:

    猜你喜欢
    • 2015-07-06
    • 2020-11-05
    • 1970-01-01
    • 2017-03-30
    • 2019-07-19
    • 1970-01-01
    • 2018-01-25
    • 2020-09-19
    • 1970-01-01
    相关资源
    最近更新 更多