Info There appears to be trouble with your network connection, Retrying...

最近在运行angular的一些测试用例,在terminal输入命令后报错:

Resolving packages...

Fetching packages...

Info There appears to be trouble with your network connection, Retrying...

Info There appears to be trouble with your network connection, Retrying...

Info There appears to be trouble with your network connection, Retrying...

error: An expeted error occurred: 'http://....tgz: tunneling socket could not be established, statusCode=403'

在网上查了好多,各种说法,五花八门,自己也试着改了一些配置,比如: 

yarn config list // 查看yarn的相关配置

npm config list  // 查看npm的相关配置

npm config set registry https://repo.xxx.xxx.xxx.npmjs

yarn config set registry https://repo.xxx.xxx.xxx.npmjs

yarn config delete ‘https-proxy’

npm config delete ‘https-proxy’

试着去对比和其他同事的配置是否一样(因为有的同事可以正常运行命令),但是改了之后还是不奏效。

最后在运行一个命令的时候这个报错消失了,但是又报出另一个错,...no permission...

然后我就知道是没有权限的缘故,然后自己试着用sudo yarn install 去运行命令,成功了,不报错了,但是之前的那个报错还是没搞懂是什么原因引起的。

发布了69 篇原创文章 · 获赞 35 · 访问量 7万+

猜你喜欢

转载自blog.csdn.net/qyl_0316/article/details/103240133