如何使用IPv6在ubuntu服务器上安装节点包

时间:2022-07-29 23:40:54

I'm trying to install typescript on an Ubuntu server where only IPv6 address space is available.

我正在尝试在Ubuntu服务器上安装打字稿,那里只有IPv6地址空间可用。

I'm getting error as follows. Any help?

我得到了如下的误差。任何帮助吗?

:/home/dev/.nvm# npm install --global typescript
npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! network request to https://registry.npmjs.org/typescript failed, reason: getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org: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!     /root/.npm/_logs/2017-11-01T19_15_39_294Z-debug.log

The error of this network connectivity happens with many packages and even github. I installed nvm in a slightly different way by setting the codebase in bitbucket.

这个网络连接的错误发生在许多包甚至github上。通过在位桶中设置代码基,我以稍微不同的方式安装了nvm。

I tried to install npm and n to setup typescript using n. That failed and I started using nvm as alternative. PFB the logs when trying to install n.

我尝试安装npm和n来使用n来设置打字稿,但失败了,我开始使用nvm作为替代。PFB:安装n时日志。

    :~# sudo npm install -g n
npm ERR! Linux 4.4.0-98-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "n"
npm ERR! node v4.2.6
npm ERR! npm  v3.5.2
npm ERR! code ENETUNREACH
npm ERR! errno ENETUNREACH
npm ERR! syscall connect

npm ERR! connect ENETUNREACH ::ffff:151.101.208.162:80 - Local (:::0)
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

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

I just need some way to get it installed but no luck! I strongly believe it is IPv6 issue and looking for work around.

我只是需要一些方法来安装它,但是没有运气!我坚信这是IPv6的问题,并且正在寻找工作。

Btw, my ubuuntu server is 16.04.3 LTS. I have installed it successfully on IPv4 servers running on Ubuntu 16.10 and 17.04 version and here in Production, I'm locked!

顺便说一句,我的ubuuntu服务器是16.04.3 LTS。我已经在运行于ubuntu16.10和17.04版本的IPv4服务器上成功安装了它,在生产中,我被锁定了!

2 个解决方案

#1


2  

I got that working after a change in registry. Could be a network problem that I faced on server OR the IPv6 only issue. Anyway the change in registry worked perfect.

我在登记注册后找到了工作。可能是我在服务器上遇到的网络问题,或者是IPv6唯一的问题。不管怎样,注册表的变化非常完美。

sudo npm --registry http://registry.node-modules.io/ install n -g

After all the link below guided me to the answer. Node-modules.io

下面的链接引导我找到了答案。Node-modules.io

Hope this will help somebody for the future reference! Thanks for @Kalana Demel for the help to reach me to the answer.

希望这对今后的工作有所帮助!感谢@Kalana Demel帮助我找到答案。

#2


0  

It seems the issue might be with proxy setting try using http instead of https, ipv6 issues seems to be resolved in the newer versions of npm as well.

似乎代理设置的问题是尝试使用http而不是https, ipv6的问题似乎在新版本的npm中也得到了解决。

npm config set registry http://registry.npmjs.org/
npm cache clean

Update

更新

It seems that the issue which was supposed to be fixed in 8.5.0 is still there, so for IPV6 only networks npm is still not working even though Node is now passing the necessary flags, so till it's fixed you will have to find a workaround.

看来8.5.0中应该解决的问题仍然存在,所以对于IPV6网络来说,即使节点正在传递必要的标志,npm仍然不能工作,所以在解决之前,您必须找到一个解决方案。

For more info : Node, NPM

更多信息:节点,NPM

#1


2  

I got that working after a change in registry. Could be a network problem that I faced on server OR the IPv6 only issue. Anyway the change in registry worked perfect.

我在登记注册后找到了工作。可能是我在服务器上遇到的网络问题,或者是IPv6唯一的问题。不管怎样,注册表的变化非常完美。

sudo npm --registry http://registry.node-modules.io/ install n -g

After all the link below guided me to the answer. Node-modules.io

下面的链接引导我找到了答案。Node-modules.io

Hope this will help somebody for the future reference! Thanks for @Kalana Demel for the help to reach me to the answer.

希望这对今后的工作有所帮助!感谢@Kalana Demel帮助我找到答案。

#2


0  

It seems the issue might be with proxy setting try using http instead of https, ipv6 issues seems to be resolved in the newer versions of npm as well.

似乎代理设置的问题是尝试使用http而不是https, ipv6的问题似乎在新版本的npm中也得到了解决。

npm config set registry http://registry.npmjs.org/
npm cache clean

Update

更新

It seems that the issue which was supposed to be fixed in 8.5.0 is still there, so for IPV6 only networks npm is still not working even though Node is now passing the necessary flags, so till it's fixed you will have to find a workaround.

看来8.5.0中应该解决的问题仍然存在,所以对于IPV6网络来说,即使节点正在传递必要的标志,npm仍然不能工作,所以在解决之前,您必须找到一个解决方案。

For more info : Node, NPM

更多信息:节点,NPM