npm安装依赖报错npm ERR! code ENOTFOUND npm ERR! errno ENOTFOUND
2023-09-14 09:09:24 时间
npm安装依赖报错
使用npm安装一个依赖包时报错,报错内容如下:
[root@D20L42 qtone-resource-fe]# npm install -g cnpm --registry=https://registry.npm.taobao.org
npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! network request to https://registry.npm.taobao.org/cnpm failed, reason: getaddrinfo ENOTFOUND registry.npm.taobao.org registry.npm.taobao.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/2021-06-15T05_39_54_815Z-debug.log
解决方法:
npm config get proxy
npm config get https-proxy
npm config set proxy null
npm config set https-proxy null
npm config set registry http://registry.cnpmjs.org/
再次安装依赖就不会报错了
npm install -g cnpm --registry=https://registry.npm.taobao.org
相关文章
- Centos7 安装docker
- npm install —— 从一个简单例子,看本地安装与全局安装的区别
- CentOS 6.5/6.6 安装(install)mysql 5.7 最完整版教程
- Node.js 笔记(一) nodejs、npm、express安装
- npm安装node-sass失败
- linux:ubuntu21.04:npm安装@vue/cli时报错(@vue/cli 4.5.13/npm 7.21.0/node 14.17.1)
- node:解决npm安装下载慢的问题(node v14.17.1/npm 7.20.5)
- linux:ubuntu21.04:npm安装@vue/cli时报错(@vue/cli 4.5.13/npm 7.21.0/node 14.17.1)
- npm安装serve实现静态资源的访问
- Verdaccio介绍及安装 -- nodejs私有npm proxy registry代理
- mac 安装 npm
- electron安装npm和cnpm均失败Failed at the electron@5.0.13 postinstall script.
- npm无法安装node-sass报错提示安装:npm rebuild node-sass却安装不了的解决办法
- 【nodejs】使用 npm安装模块方法
- npm从非官方源安装
- npm安装依赖:全局包、本地包、测试包、package.json
- 001-使用idea开发环境安装部署,npm工具栏,脚本运行
- npm的安装和使用?
- npm 安装参数中的 --save-dev 是什么意思
- 开源防火墙pfSense的安装及初始化
- Win7安装win10,无需全盘重新分区,原MBR格式转GPT格式,创建EFI和MSR分区,安装win10