Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] run "npm publish" then "ERR! code ETIMEDOUT" #7082

Closed
1 task done
wd3322 opened this issue Dec 14, 2023 · 26 comments
Closed
1 task done

[BUG] run "npm publish" then "ERR! code ETIMEDOUT" #7082

wd3322 opened this issue Dec 14, 2023 · 26 comments
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 10.x

Comments

@wd3322
Copy link

wd3322 commented Dec 14, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

run "npm publish" or "npm login"

image
image
image

npm ERR! code ETIMEDOUT
npm ERR! errno ETIMEDOUT
npm ERR! network request to https://registry.npmjs.org/el-table-model failed, reason: connect ETIMEDOUT 104.16.29.34:443
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\asus\AppData\Roaming\npm-cache_logs\2023-12-14T01_27_18_524Z-debug.log

Environment

  • npm: 6.14.18
  • Node.js: 14.21.3
  • OS Name: Windows
  • System Model Name:
  • npm config:
@wd3322 wd3322 added Bug thing that needs fixing Needs Triage needs review for next steps Release 10.x labels Dec 14, 2023
@Thecodefirst
Copy link

me too.

3 similar comments
@linzhe141
Copy link

me too.

@haixin-fang
Copy link

me too.

@liluanhui
Copy link

me too.

@Thecodefirst
Copy link

Yes, please set npm config set proxy

@wd3322
Copy link
Author

wd3322 commented Dec 14, 2023

Yes, please set npm config set proxy

兄弟是中国人吗, 这类设置我已经处理过了, 仍然没有效果

@liluanhui
Copy link

Yes, please set npm config set proxy

兄弟是中国人吗, 这类设置我已经处理过了, 仍然没有效果

兄弟可以发布了,什么也没处理,我刚试了重新 publish 没问题。

@wd3322
Copy link
Author

wd3322 commented Dec 14, 2023

Yes, please set npm config set proxy

兄弟是中国人吗, 这类设置我已经处理过了, 仍然没有效果

兄弟可以发布了,什么也没处理,我刚试了重新 publish 没问题。

我还是不行,难受

@tangbzai
Copy link

我这里不仅 publish 命令不行,就连 npm install -g npmnpm login 都会出现相同的错误,而且如果切换registryhttp://registry.npmjs.org/的话login的时候可以输入用户名和密码(只是因为非 https 会报 TSL 错误,依旧登录失败)。
所以可能问题和https有关


I am not only publish here, but even the npm install -g npm and npm login will have the same errors, and If I change registry to http://registry.npmjs.org/, i can enter the username and password (just because the non -https will report the TSL error, it still fails).
So i think the problem may be related to https

@wd3322
Copy link
Author

wd3322 commented Dec 15, 2023

我这里不仅 publish 命令不行,就连 npm install -g npmnpm login 都会出现相同的错误,而且如果切换registryhttp://registry.npmjs.org/的话login的时候可以输入用户名和密码(只是因为非 https 会报 TSL 错误,依旧登录失败)。 所以可能问题和https有关

I am not only publish here, but even the npm install -g npm and npm login will have the same errors, and If I change registry to http://registry.npmjs.org/, i can enter the username and password (just because the non -https will report the TSL error, it still fails). So i think the problem may be related to https

确实如此,一开始我怀疑是自己的问题,现在想想应该不是,各种办法我都尝试了,切换过node14/16/18/20,npm6/8/10等版本,翻墙、连接手机热点(ipv6)、设置proxy,结果全都是超时

@Pursuemc
Copy link

设置代理之后成功了。

@huqiliang
Copy link

设置代理之后成功了。

咋弄的?我和楼上一样 各种方法都试了 还是不行

@it-chenliang
Copy link

我也遇到这个问题了,现在无论是npm login还是npm install或是npm adduser都是这个ETIMEDOUT错误,然后我刚刚看到有人说他也遇到这个问题了,就切换到手机热点可以使用,我抱着尝试的心态试了下,结果还真的可以了,回头来看好像错误提示里有说是This is a problem related to network connectivity.网络问题。
image

@it-chenliang
Copy link

设置代理之后成功了。

咋弄的?我和楼上一样 各种方法都试了 还是不行

试试连手机热点,我反正用手机热点是可以了

@linzhe141
Copy link

今天能够pnpm install 下载了,npm install还是不行,昨天这两个都不行,都说网络问题
不过pnpm i 显示downloaded显示0,不知道是不是没有走网络下载
image

我这里不仅 publish 命令不行,就连 npm install -g npmnpm login 都会出现相同的错误,而且如果切换registryhttp://registry.npmjs.org/的话login的时候可以输入用户名和密码(只是因为非 https 会报 TSL 错误,依旧登录失败)。 所以可能问题和https有关

I am not only publish here, but even the npm install -g npm and npm login will have the same errors, and If I change registry to http://registry.npmjs.org/, i can enter the username and password (just because the non -https will report the TSL error, it still fails). So i think the problem may be related to https

@huqiliang
Copy link

设置代理之后成功了。

咋弄的?我和楼上一样 各种方法都试了 还是不行

试试连手机热点,我反正用手机热点是可以了

可以了 多谢 手机热点我之前试过不行。

其他类似问题朋友 建议手机热点 多试几次

@linzhe141
Copy link

设置代理之后成功了。

怎么设置代理?

@xiaoshuoyiyi
Copy link

我试了,手机热点也不行

@Lucas0819
Copy link

Lucas0819 commented Dec 15, 2023

如果现象为可以通过浏览器打开 https://registry.npmjs.org ,但是执行命令npm ping失败,有可能是npm命令没有被成功的代理。
设置npm的proxy为本地VPN工具的代理端口:

npm config set proxy http://127.0.0.1:7890

亲测有效。

@xiaoshuoyiyi
Copy link

如果现象为可以通过浏览器打开https://registry.npmjs.org ,但是执行命令npm ping失败,有可能是npm命令没有被成功的代理。 设置npm的代理为本地VPN工具的代理端口:

npm config set proxy http://127.0.0.1:7890

亲测有效。

你也用的Clash Verge?

@Lucas0819
Copy link

如果现象为可以通过浏览器打开https://registry.npmjs.org ,但是执行命令npm ping失败,有可能是npm命令没有被成功的代理。 设置npm的代理为本地VPN工具的代理端口:

npm config set proxy http://127.0.0.1:7890

亲测有效。

你也用的Clash Verge?

ClashXR

@Lucas0819
Copy link

如果现象为可以通过浏览器打开https://registry.npmjs.org ,但是执行命令npm ping失败,有可能是npm命令没有被成功的代理。 设置npm的代理为本地VPN工具的代理端口:

npm config set proxy http://127.0.0.1:7890

亲测有效。

你也用的Clash Verge?

也可以尝试在VPN工具的规则匹配内,手动新增npmjs.org规则。猜测可能是近期被墙,VPN规则配置未同步。

@wd3322
Copy link
Author

wd3322 commented Dec 15, 2023

如果现象为可以通过浏览器打开 https://registry.npmjs.org ,但是执行命令npm ping失败,有可能是npm命令没有被成功的代理。 设置npm的proxy为本地VPN工具的代理端口:

npm config set proxy http://127.0.0.1:7890

亲测有效。

成功了, 这条操作是目前最有效的, 不知道为何工信部要去墙npm

@chengliang666
Copy link

通过浏览器打开https://registry.npmjs.org/ ,获取IP地址,然后在本地hosts配置代理就可以了,亲测有效。
104.16.28.34 registry.npmjs.org

@milaninfy
Copy link
Contributor

Closing: this looks to be an issue with the registry which is outside the scope of this repo. For registry support please go to npmjs.com/support. If you believe this is a bug with the cli, please provide further clarifying details.

@milaninfy milaninfy closed this as not planned Won't fix, can't repro, duplicate, stale Jun 21, 2024
@MuYi086
Copy link

MuYi086 commented Jul 26, 2024

我是使用以下俩个操作,然后可以正常npm login 和publish了

  1. 使用ping.cn拿到了延迟比较低的ip,然后粘贴到hosts;
  2. 更换dns,使用1.1.1.1或者8.8.8.8,这俩个对国外网站比较友好
    之后可以尝试访问https://registry.npmjs.org,能正常返回200基本就通了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 10.x
Projects
None yet
Development

No branches or pull requests