gpt4 book ai didi

node.js - 尝试使用 npm 安装任何内容时出错

转载 作者:太空宇宙 更新时间:2023-11-03 22:13:27 25 4
gpt4 key购买 nike

我正在通过 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 以便我可以安装这些模块。谢谢。

最佳答案

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

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

关于node.js - 尝试使用 npm 安装任何内容时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35753788/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com