当前位置:网站首页>npm安装依赖报错npm ERR! code ENOTFOUNDnpm ERR! syscall getaddrinfonpm ERR! errno ENOTFOUND
npm安装依赖报错npm ERR! code ENOTFOUNDnpm ERR! syscall getaddrinfonpm ERR! errno ENOTFOUND
2022-08-04 05:16:00 【S筱潇S四维Smile】
npm ERR! code ENOTFOUND
npm ERR! syscall getaddrinfo
npm ERR! errno ENOTFOUND
npm ERR! network request to http://registry.cnpmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz failed, reason: getaddrinfo ENOTFOUND registry.cnpmjs.org
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'
根据网上搜的解决方法:
1、执行:
npm config get proxy
npm config get https-proxy
如果返回值不为null,继续执行:
(这一步很重要,一定要保证两个命令的返回值都为null,话说回来,应该出现这个错误这两个返回值有不为null的)
npm config set proxy null
npm config set https-proxy null
2、执行:
npm config set registry https://registry.cnpmjs.org/
试了一下我的还是不行,然后又搜别的方法:
直接修改npmrc文件,就是npm的配置文件所在位置。
因为是隐藏文件,直接搜索文件即可
打开修改该文件即可:
http-proxy=http://proxyhost/:proxyport
strict-ssl=false
registry=https://registry.npmjs.org/
然后重新安装依赖就可以了
边栏推荐
- 你以为border-radius只是圆角吗?【各种角度】
- C专家编程 第4章 令人震惊的事实:数组和指针并不相同 4.1 数组并非指针
- How to simplify the automation of modern e-procurement?
- el-Select selector bottom fixed
- 企业需要知道的5个 IAM 最佳实践
- Bolb analysis of image processing (1)
- Write golang simple C2 remote control based on gRPC
- 7-2 LVS+DR Overview and Deployment
- What is the salary of a software testing student?
- redis中常见的面试题
猜你喜欢
There is an 8 hour difference between the docker installation of mysql and the host.
Mini program + e-commerce, fun new retail
px、em、rem的区别
[One step in place] Jenkins installation, deployment, startup (complete tutorial)
[C language advanced] program environment and preprocessing
《看见新力量》第四期免费下载!走进十五位科技创业者的精彩故事
el-Select 选择器 底部固定
sql server如何得到本条记录与上一条记录的差异,即变动值
心余力绌:企业面临的软件供应链安全困境
Structure function exercise
随机推荐
C专家编程 第5章 对链接的思考 5.4 警惕Interpositioning
Gartner 权威预测未来4年网络安全的8大发展趋势
【21 Days Learning Challenge】Direct Insertion Sort
解决错误:npm WARN config global `--global`, `--local` are deprecated
idea设置识别.sql文件类型以及其他文件类型
备份工具pg_dump的使用《postgres》
centos 安装postgresql13 指定版本
ADC噪声全面分析 -03- 利用噪声分析进行实际设计
C专家编程 第4章 令人震惊的事实:数组和指针并不相同 4.3 什么是声明,什么是定义
C Expert Programming Chapter 4 The Shocking Fact: Arrays and Pointers Are Not the Same 4.5 Other Differences Between Arrays and Pointers
8款最佳实践,保护你的 IaC 安全!
入坑软件测试的经验与建议
How to dynamically add script dependent scripts
3000字,一文带你搞懂机器学习!
TSF微服务治理实战系列(一)——治理蓝图
文献管理工具 | Zotero
System design. How to design a spike system (full version transfer)
See how DevExpress enriches chart styles and how it empowers fund companies to innovate their business
Interesting Kotlin 0x0E: DeepRecursiveFunction
Use Patroni callback script to bind VIP pit