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,刷新状态

相关推荐
passer9811 分钟前
基于Vue的场景解决
前端·vue.js
用户458203153173 分钟前
CSS过渡(Transition)详解:创建平滑状态变化
前端·css
春秋半夏6 分钟前
本地项目一键开启 HTTPS(mkcert + Vite / Vue 配置教程)
前端
穿花云烛展21 分钟前
实习日记2(与form表单的爱恨情仇1)
前端
岛风风30 分钟前
分享一下Monorepo 的理解和不同类型项目的目录结构
前端
ITMan彪叔33 分钟前
Tesseract OCR 页面分割模式解析
前端
w_y_fan34 分钟前
Flutter中的沉浸式模式设置
前端·flutter
游荡de蝌蚪35 分钟前
快速打造Vue后台管理系统
前端·javascript·vue.js
code_YuJun36 分钟前
3. 修改 vue.config.js 配置完成打包分析和优化
前端
文心快码BaiduComate44 分钟前
轻松实践:用Python实现“名字大作战”游戏,表白Zulu!
前端·后端·微信小程序