node.js - NPM,从错误的 URL 地址下载依赖项
问题描述
在处理了一些项目之后,我的 npm 开始从错误的地址全局下载依赖项:
npm install -g bower
npm ERR! code ETIMEDOUT
npm ERR! errno ETIMEDOUT
npm ERR! network request to http://172.168.1.1/bower failed, reason:
connect ETIMEDOUT 172.168.1.1
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:
有什么方法可以将下载地址重置为默认地址吗?
我正在使用 Windows 版本的 NodeJS
解决方案
看起来您的registry
npm 配置选项指向错误的位置。它必须是https://registry.npmjs.org,使用以下命令进行检查:
npm config get registry
如果您的注册表不同,请使用此命令正确设置:
npm config set registry https://registry.npmjs.org/
推荐阅读
- php - 如何从 json 响应 laravel 中获取选定的值?
- node.js - 续集 | Node.js,在两个数字之间搜索
- ios - 带有collectionview的自定义菜单栏
- javascript - pg-promise TypeError:无效的“选项”参数
- javascript - java - 如何在java脚本中从值文件输入复制到动态输入文件值?
- python - 在 Django 中加载媒体文件
- unity3d - 我应该在两边都添加信息吗
- vagrant - 跳过/忽略 vagrant up 的启动错误
- wordpress - 如何通过钩子更改或修改 woocommerce 管理订单标题?
- c# - 无法以以下格式添加 Jproperty 值 ["r0"]