解决npm问题:错误的代理设置

embedded/2025/2/22 12:57:12/

错误的代理设置

npm install vue-waterfall-plugin-next
npm ERR! code ECONNREFUSED
npm ERR! syscall connect
npm ERR! errno ECONNREFUSED
npm ERR! FetchError: request to https://registry.npmmirror.com/vue-waterfall-plugin-next failed, reason: connect ECONNREFUSED 127.0.0.1:31181
npm ERR!     at ClientRequest.<anonymous> (F:\Tools\nodejs\node_modules\npm\node_modules\minipass-fetch\lib\index.js:130:14)
npm ERR!     at ClientRequest.emit (node:events:517:28)
npm ERR!     at onerror (F:\Tools\nodejs\node_modules\npm\node_modules\agent-base\dist\src\index.js:117:21)
npm ERR!     at callbackError (F:\Tools\nodejs\node_modules\npm\node_modules\agent-base\dist\src\index.js:136:17)
npm ERR!     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
npm ERR!  FetchError: request to https://registry.npmmirror.com/vue-waterfall-plugin-next failed, reason: connect ECONNREFUSED 127.0.0.1:31181
npm ERR!     at ClientRequest.<anonymous> (F:\Tools\nodejs\node_modules\npm\node_modules\minipass-fetch\lib\index.js:130:14)
npm ERR!     at ClientRequest.emit (node:events:517:28)
npm ERR!     at onerror (F:\Tools\nodejs\node_modules\npm\node_modules\agent-base\dist\src\index.js:117:21)
npm ERR!     at callbackError (F:\Tools\nodejs\node_modules\npm\node_modules\agent-base\dist\src\index.js:136:17)
npm ERR!     at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
npm ERR!   code: 'ECONNREFUSED',
npm ERR!   errno: 'ECONNREFUSED',
npm ERR!   syscall: 'connect',
npm ERR!   address: '127.0.0.1',
npm ERR!   port: 31181,
npm ERR!   type: 'system',
npm ERR!     at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
npm ERR!   code: 'ECONNREFUSED',
npm ERR!   errno: 'ECONNREFUSED',
npm ERR!   syscall: 'connect',
npm ERR!   address: '127.0.0.1',
npm ERR!   port: 31181,
npm ERR!   type: 'system',
npm ERR!   code: 'ECONNREFUSED',
npm ERR!   errno: 'ECONNREFUSED',
npm ERR!   syscall: 'connect',
npm ERR!   address: '127.0.0.1',
npm ERR!   port: 31181,
npm ERR!   type: 'system',
npm ERR!   syscall: 'connect',
npm ERR!   address: '127.0.0.1',
npm ERR!   port: 31181,
npm ERR!   type: 'system',
npm ERR!   type: 'system',
npm ERR!   requiredBy: '.'
npm ERR! }
npm ERR!
npm ERR! If you are behind a proxy, please make sure that the
npm ERR! 'proxy' config is set properly.  See: 'npm help config'npm ERR! A complete log of this run can be found in: F:\Tools\nodejs\node_cache\_logs\2025-02-20T01_02_46_768Z-debug-0.log

遇到此问题是因为 npm 配置了错误的代理设置,导致尝试通过本地未被监听的端口(127.0.0.1:31181)进行连接。以下是分步解决方案:

步骤 1:清除 npm 的代理配置

在命令行中执行以下命令,移除可能存在的代理设置:

npm config delete proxy
npm config delete https-proxy

步骤 2:检查环境变量中的代理设置

确保没有设置 HTTP_PROXYHTTPS_PROXY 环境变量。在 Windows 的 CMD 中运行:

set HTTP_PROXY
set HTTPS_PROXY

如果发现这些变量被设置,需要取消设置。在 CMD 中:

set HTTP_PROXY=
set HTTPS_PROXY=

在环境变量中将 HTTP_PROXY和 HTTPS_PROXY 删除
重新npm install xxx 即可成功。


http://www.ppmy.cn/embedded/164332.html

相关文章

论文解读 | AAAI'25 Cobra:多模态扩展的大型语言模型,以实现高效推理

点击蓝字 关注我们 AI TIME欢迎每一位AI爱好者的加入&#xff01; 点击 阅读原文 观看作者讲解回放&#xff01; 个人信息 作者&#xff1a;赵晗&#xff0c;浙江大学-西湖大学联合培养博士生 内容简介 近年来&#xff0c;在各个领域应用多模态大语言模型&#xff08;MLLMs&…

Flutter开发的应用页面非常多时如何高效管理路由

文章目录 1. 集中式路由管理示例&#xff1a; 2. 动态路由生成 (onGenerateRoute)示例&#xff1a; 3. 模块化路由管理示例&#xff1a; 4. 使用路由管理库使用go_router的示例&#xff1a; 5. 路由分层管理总结 当Flutter应用中有大量页面时&#xff0c;路由管理变得复杂。为了…

CT dicom 去除床板 去除床位,检查床去除

1. 前言 医院拍摄患者CT与MRI 图像&#xff0c; 但是CT图像中就会出现检查床的区域&#xff0c;来看CT扫描设备是什么样子的&#xff0c;红色标出区域 可以在图中看到&#xff0c;在头部位置安装有固定头部的类似支架的东西&#xff0c;这个东西拍摄出来时什么样子呢&#xff…

ubuntu 守护进程

#!/bin/bash # 定义所守护的进程名称或关键字 TARGET_PROCESS"AppRun" while true; do # 检测目标进程是否运行 if pgrep -x "$TARGET_PROCESS" >/dev/null; then echo "The process is running." else # 启…

Docker安装Quickwit搜索引擎

介绍 Quickwit 是首个以亚秒级延迟直接在云存储上执行复杂搜索和分析查询的引擎。它由 Rust 及其分离的计算和存储架构提供支持&#xff0c;旨在节省资源、易于操作并可扩展到 PB 级数据。 Quickwit 非常适合日志管理、分布式跟踪以及通常不可变的数据&#xff08;例如对话数…

PTT 票据传递攻击

黄金票据 原理&#xff1a;获取 krbtgt 的哈希后&#xff0c;使用此哈希能离线生成任意域用户的 tgt&#xff0c;域管理员的 tgt 就是黄金票据。 mimikatz.exe "privilege::debug" "lsadump::dcsync /domain:HACK.com /user:HACK\krbtgt /csv" "exit…

tidb实时同步到mysql

客户要求实时同步表的数据到mysql&#xff0c;但这个表在tidb。 测试直接通过tidb cdc写入到mysql&#xff0c;有些字段是null&#xff0c;所以中间加了一个kafka实现 客户库中创建表 CREATE TABLE tb_1 (id bigint primary key,cid bigint,gid bigint,fee DECIMAL(10,2),cre…

双非一本电子信息专业自学嵌入式,学完 Linux 后咋走?单片机 FreeRTOS 要补吗?

今天给大家分享的是一位粉丝的提问&#xff0c;双非一本电子信息专业自学嵌入式&#xff0c;学完 Linux 后咋走&#xff1f;单片机 & FreeRTOS 要补吗&#xff1f; 接下来把粉丝的具体提问和我的回复分享给大家&#xff0c;希望也能给一些类似情况的小伙伴一些启发和帮助。…