npm install 报错 ‘proxy‘ config is set properly. See: ‘npm help config‘

简介: npm install 报错 ‘proxy‘ config is set properly. See: ‘npm help config‘

问题:使用 npm install 初始化项目依赖失败,报错 'proxy' config is set properly. See: 'npm help config'

npm WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning ETIMEDOUT: request to https://registry.npmjs.org/vue-ref failed, reason: connect ETIMEDOUT 104.16.20.35:443
npm WARN registry Using stale data from https://registry.npmjs.org/ due to a request error during revalidation.
npm ERR! code ETIMEDOUT
npm ERR! errno ETIMEDOUT
npm ERR! network request to https://registry.npmjs.org/dom-closest failed, reason: connect ETIMEDOUT 104.16.22.35: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!     /Users/dengzemiao/.npm/_logs/2022-11-14T04_51_31_564Z-debug.log

1、先查找一下自己的代理

$ npm config get proxy
$ npm config get npm config get https-proxy
$ npm config get registry

2、然后将代理和缓存置空

方式一:

$ npm config set proxy false
$ npm cache clean --force

方式二:

$ npm config set proxy null
$ npm config set https-proxy null

3、配置新的镜像源,选一个就行

# 淘宝源(推荐)
$ npm config set registry http://registry.npm.taobao.org/
# 官方源
$ npm config set registry http://registry.npmjs.org/
$ npm config set registry https://registry.npmjs.org/
# cnpm 源
$ npm config set registry https://registry.cnpmjs.org/
# 如果使用 cnpm,注意是否安装了 cnpm,cnpm 走推荐走的也是淘宝源
$ npm install -g cnpm --registry=https://registry.npm.taobao.org/
相关文章
|
9月前
|
SQL Oracle 关系型数据库
实时计算 Flink版操作报错之往GREENPLUM 6 写数据,用postgresql-42.2.9.jar 报 ON CONFLICT (uuid) DO UPDATE SET 语法有问题。怎么解决
在使用实时计算Flink版过程中,可能会遇到各种错误,了解这些错误的原因及解决方法对于高效排错至关重要。针对具体问题,查看Flink的日志是关键,它们通常会提供更详细的错误信息和堆栈跟踪,有助于定位问题。此外,Flink社区文档和官方论坛也是寻求帮助的好去处。以下是一些常见的操作报错及其可能的原因与解决策略。
|
4月前
|
Java 数据库连接
nacos2.0.3报错No Datasource Set
nacos2.0.3报错No Datasource Set com.mysql.cj.exceptions.CJException: Public Key Retrieval is not allowed
nacos2.0.3报错No Datasource Set
|
21天前
|
Java Spring 容器
springcloud-config客户端启用服务发现报错找不到bean EurekaHttpClient
解决 Spring Cloud Config 客户端启用服务发现时报错找不到 bean `EurekaHttpClient` 的问题,主要涉及版本兼容性、依赖配置和正确的配置文件设置。通过检查依赖版本、添加必要的依赖项、配置文件的正确性以及启用服务发现注解,可以有效解决此问题。确保日志中没有其他错误信息也是关键步骤之一。通过这些方法,可以确保 Spring Cloud Config 与 Eureka 客户端正常工作。
24 6
|
2月前
|
Java Maven Spring
【SpringBug】lombok插件失效,但是没有报错信息,@Data不能生成get和set方法
解决写了@Data注解,但是在测试文件中生成的反编译target文件Us二Info中没有get和set方法
251 15
|
3月前
|
JSON Java 关系型数据库
Java更新数据库报错:Data truncation: Cannot create a JSON value from a string with CHARACTER SET 'binary'.
在Java中,使用mybatis-plus更新实体类对象到mysql,其中一个字段对应数据库中json数据类型,更新时报错:Data truncation: Cannot create a JSON value from a string with CHARACTER SET 'binary'.
331 4
Java更新数据库报错:Data truncation: Cannot create a JSON value from a string with CHARACTER SET 'binary'.
|
6月前
|
JavaScript API
Vue3 运行可以,build 打包发布报错,app.config.globalProperties 用法坑
Vue3 运行可以,build 打包发布报错,app.config.globalProperties 用法坑
143 2
|
6月前
|
Ubuntu Python
ubuntu build install python3.12 and config pip
该脚本用于在 Ubuntu 上编译安装 Python 3.12,并配置 pip 使用国内镜像源。主要步骤包括安装依赖、下载并解压 Python 源码、编译安装、创建符号链接、配置 pip 源,以及验证安装和更新 pip。通过运行此脚本,可以快速完成 Python 3.12 的安装和配置。
194 0
|
8月前
|
SQL 分布式计算 前端开发
MaxCompute操作报错合集之SQL脚本设置参数set odps.mapred.reduce.tasks=18;没有生效,是为什么
MaxCompute是阿里云提供的大规模离线数据处理服务,用于大数据分析、挖掘和报表生成等场景。在使用MaxCompute进行数据处理时,可能会遇到各种操作报错。以下是一些常见的MaxCompute操作报错及其可能的原因与解决措施的合集。
208 5
|
8月前
|
存储 Kubernetes 安全
云上攻防-云原生篇&K8s安全&Config泄漏&Etcd存储&Dashboard鉴权&Proxy暴露
云上攻防-云原生篇&K8s安全&Config泄漏&Etcd存储&Dashboard鉴权&Proxy暴露
176 5

推荐镜像

更多