npm使用了代理,但是代理软件已经关闭导致创建失败

如果在关闭前打开了vscode,此时vscode中的终端没有刷新,就会出现这个问题,最开始会一直转圈圈,直到超时,然后出现该报错

bash 复制代码
❯ npm create vue@latest
npm error code ECONNREFUSED
npm error syscall connect
npm error errno ECONNREFUSED
npm error FetchError: request to https://registry.npmjs.org/create-vue failed, reason: connect ECONNREFUSED 127.0.0.1:12334
npm error     at ClientRequest.<anonymous> (/home/ying/.nvm/versions/node/v22.13.1/lib/node_modules/npm/node_modules/minipass-fetch/lib/index.js:130:14)
npm error     at ClientRequest.emit (node:events:524:28)
npm error     at emitErrorEvent (node:_http_client:104:11)
npm error     at _destroy (node:_http_client:898:9)
npm error     at onSocketNT (node:_http_client:918:5)
npm error     at process.processTicksAndRejections (node:internal/process/task_queues:91:21) {
npm error   code: 'ECONNREFUSED',
npm error   errno: 'ECONNREFUSED',
npm error   syscall: 'connect',
npm error   address: '127.0.0.1',
npm error   port: 12334,
npm error   type: 'system'
npm error }
npm error
npm error If you are behind a proxy, please make sure that the
npm error 'proxy' config is set properly.  See: 'npm help config'
npm error A complete log of this run can be found in: /home/ying/.npm/_logs/2025-02-22T07_28_54_852Z-debug-0.log

解决办法

重新打开vscode,刷新状态

相关推荐
月忆36419 分钟前
等待组(waitgroup)
前端·爬虫·python
令狐寻欢22 分钟前
HTML中 的 meta 标签常用属性及其作用
前端·html
SynthWriter27 分钟前
Trae 帮我生成了一个贪吃蛇的游戏,好玩儿
前端
用户214118326360240 分钟前
dify案例分享-Dify+RSS 聚合 8 大平台实时热点,新闻获取效率飙升 300%
前端
百锦再42 分钟前
Razor编程中@Html的方法使用大全
前端·html
啪叽1 小时前
JavaScript可选链操作符(?.)的实用指南
前端·javascript
Ian在掘金1 小时前
bat+python实现easy connect自动连接
前端·python
代码搬运媛1 小时前
【react实战】如何实现监听窗口大小变化
前端·javascript·react.js
小桥风满袖1 小时前
Three.js-硬要自学系列30之专项学习环境光
前端·css·three.js
Luckyfif1 小时前
🤯由 性能指标 散发开来的 Performance API 被问爆了呀
前端·面试·性能优化