尝试使用npm
安装软件包时出现此错误:
[![错误消息][1]][1]
从我读到的,这是关于无法连接到https://registry.npmjs.org/
我尝试使用npm config set registry
,但它没有解决问题。
是什么阻止了这个工作?
顺便说一句,我找到了一个解决方案。解决办法是转换互联网。我想这是因为宿舍的连接。谢谢你所做的一切[1]: https://i.stack.imgur.com/zFdpS.png如果您有代理问题,例如当您的公司使用Artifactory作为NPM注册表时,您可以尝试(在Windows上工作):
cd ~ # go to user directory
touch .npmrc # create the file if don't exist
编辑文件并添加:
registry https://artifactory.your-domain.fr/artifactory/api/npm/npm-virtual/=
registry=https://artifactory.your-domain.fr/artifactory/api/npm/npm-virtual/
# strict-ssl=false # you may need that if you company install an intermediate certificate on your machine (they spy on you HTTPS ;)).
your-domain.fr
更换位置
你试过下面的方法吗?
npm --without-ssl --insecure i ethers
如果您知道您正在使用的代理的详细信息:
npm config set proxy http://[username]:[password]@[host]:[port]