English 中文(简体)
npm ERR! Error:link ECONNREFUSED 在试图更新时
原标题:npm ERR! Error: connect ECONNREFUSED when trying to update the npm

I m trying to update the npm (node package manager) using the command:

npmstal@latestf -

但是,我在指挥中发现以下错误:

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\
node_modules\npm\bin\npm-cli.js" "install" "npm@latest" "-g"

npm ERR! node v6.9.5
npm ERR! npm  v3.10.10
npm ERR! code ECONNREFUSED
npm ERR! errno ECONNREFUSED
npm ERR! syscall connect

npm ERR! Error: connect ECONNREFUSED xxx.xxx.xx.xxx:xxx
npm ERR!     at Object.exports._errnoException (util.js:1022:11)
npm ERR! If you are behind a proxy, please make sure that the
npm ERR!  proxy  config is set properly.  See:  npm help config 

does someone know what this really means?
any help would be appreciated.

最佳回答

If you are behind a proxy, please make sure that the npm ERR! proxy config is set properly. 见: npm help config

见:

更多信息:

问题回答

Try:

npm config set proxy null
npm config set https-proxy null
npm config set registry http://registry.npmjs.org/

头两条将删除任何代理。

第三行将<代码>npm 从正式一揽子登记册下载。

我一直试图通过解决这一问题。

npm config set registry http://registry.npmjs.org/
npm config set proxy http://myproxyblabla:myport
npm config set https-proxy http://myproxyblabla:myport

但它没有帮助。 唯一一个为我

151.101.36.162 registry.npmjs.com
151.101.36.162 registry.npmjs.org

This allowes npm to resolve address to server from which it will download needed files. You can get familiar with closed issue on npm repository where this solution is approved by npm contributors.

当我利用Node JS在代理服务器上使用时,我就会出现类似的错误。 在此,我必须做些什么来纠正:

npm config set proxy http://jdoe:[email protected]:8080
npm config set https-proxy http://jdoe:[email protected]:8080

仅用你自己的全权证书取代“jdoe”和“password123”。 @之后的一切都是服务器域名,或你也可以进入准确的IP地址。 就我而言,这两个地址都是吉大港山区。

为了证实这些变化,你可以类型如下:

npm config list

应列出贵国的情况。

你也可以从你的浏览器处获得代理环境(地址)。

这里的问题是代理。 因此,你需要掌握以下指挥系统,以删除代理,然后从http://registry.npmjs.org/上建立登记册。

    npm config set proxy null
    npm config set https-proxy null
    npm config set registry http://registry.npmjs.org/

那么,你可以通过使用:

    npx create-react-app your-app-name

我有同样的错误,使用Mullvad TER。 通过使IPv6能够在Mullvad环境中进行确定。

这可能帮助需要帮助的人。 我在浪费了2小时之后就转向了这一解决办法,因为我的公司代理服务器没有解决手提电脑问题。

I removed both proxy and https-proxy from .npmrc file and set only

npmconfig set list http://registry.npmjs.org/

然后,我能够成功操作<代码>npm 安装——g 产生-react-app

.npmrc file can be found here at C:Users<userName>.npmrc

Cheers! Happy Quarantine Development:p

我与我的<代码>cra有着同样的问题,我必须做的是评论我的<代码>.npmrc,清理海滩,并管理指挥<代码>npx生成-react-app。

我们最近也面临同样的问题,我们的要求是利用公共午餐登记作为一种特征,并为另一个特征使用私人登记处。 因此,对于私人登记处,Npm需要代理,但对于公共登记处,我们不需要代理,因此,我们在项目内建立了<代码>>npmrc,并增加了两个汇变量:

registry and noproxy where noproxy points to the public domain of the registry. This will make sure to skip the proxy config from your global npmrc file.

i am also having the same issue where the npm is unable to install any of library or unable to create-react-app using npx.Even i am not connected to any proxy i.e. i am connected to my personal mobile wifi, why does this is happening with me. here is the snippet::

C:UsersAsus>npm install - g npm@latest npm ERR! code ECONNREFUSED npm ERR! errno ECONNREFUSED npm ERR! FetchError: request to http://registry.npmjs.org/npm failed, reason: npm ERR! at ClientRequest. (C:Program Files odejs ode_modules pm ode_modulesminipass-fetchlibindex.js:130:14) npm ERR! at ClientRequest.emit (node:events:518:28) npm ERR! at _destroy (node:_http_client:875:13) npm ERR! at onSocketNT (node:_http_client:895:5) npm ERR! at process.processTicksAndRejections (node:internal/process/task_queues:83:21) npm ERR! FetchError: request to http://registry.npmjs.org/npm failed, reason: npm ERR! at ClientRequest. (C:Program Files odejs ode_modules pm ode_modulesminipass-fetchlibindex.js:130:14) npm ERR! at ClientRequest.emit (node:events:518:28) npm ERR! at _destroy (node:_http_client:875:13) npm ERR! at onSocketNT (node:_http_client:895:5) npm ERR! at process.processTicksAndRejections (node:internal/process/task_queues:83:21) { npm ERR! code: ECONNREFUSED , npm ERR! errno: ECONNREFUSED , npm ERR! type: system npm ERR! } 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! A complete log of this run can be found in: C:UsersAsusAppDataLocal pm-cache_logs2024-02-18T02_50_20_203Z-debug-0.log

我们之所以出现这一错误信息,是因为马文·恩克斯-国家预防机制保存人在同一机器上运行,因此我们首先使用<代码>http:// localhost/xyz/作为国家预防机制的URL存放处。

For whatever reason, localhost was treated as a system-type NPM registry, causing errors.

将“URL”存放处改为计算机主机名称,例如<编码>http://mycomputer.company.intra/xyz/ 这个问题是固定的。

对我来说,这是为了使温得主控制小组的1.0元元用于我的发展变化:

Control Panel > Programs and profiless >特恩Windows profiles on or off > SMB1.0

enter image description here





相关问题
How to make Sequelize use singular table names

I have an model called User but Sequelize looks for the table USERS whenever I am trying to save in the DB. Does anyone know how to set Sequelize to use singular table names? Thanks.

What is Node.js? [closed]

I don t fully get what Node.js is all about. Maybe it s because I am mainly a web based business application developer. What is it and what is the use of it? My understanding so far is that: The ...

Clientside going serverside with node.js

I`ve been looking for a serverside language for some time, and python got my attention somewhat. But as I already know and love javascript, I now want learn to code on the server with js and node.js. ...

Can I use jQuery with Node.js?

Is it possible to use jQuery selectors/DOM manipulation on the server-side using Node.js?

How do I escape a string for a shell command in node?

In nodejs, the only way to execute external commands is via sys.exec(cmd). I d like to call an external command and give it data via stdin. In nodejs there does yet not appear to be a way to open a ...

热门标签