npm i安装three报错network 'proxy' config is set properly. See: 'npm help config'

396 阅读1分钟

安装依赖时报错

npm ERR! network request to registry.cnpmjs.org/three failed, reason: getaddrinfo ENOTFOUND registry.npm.taobao.orge 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犯错!network与网络连通性有关的问题。 npm犯错!网络在大多数情况下,你背后的代理或有坏的网络设置。 npm犯错!网络 npm犯错!网络如果你是一个代理,请确保 npm犯错!网络“代理”配置设置正确。 参见:'npm help config'

解决办法:

第一步:关闭代理

npm config set proxy false

第二步:清除缓存

npm cache clean

如果清除缓存报错

As of npm@5, the npm cache self-heals from corruption issues and data extracted from the cache is guaranteed to be valid. If you want to make sure everything is consistent, use 'npm cache verify' instead. On the other hand, if you're debugging an issue with the installer, you can use npm install --cache /tmp/empty-cache to use a temporary cache instead of nuking the actual one. npm ERR! npm ERR! If you're sure you want to delete the entire cache, rerun this command with --force.

强制清除

npm cache clean --force

最后一步

重新安装依赖就可以了 npm i three