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

相关推荐
萌新小码农‍6 分钟前
SpringBoot+alibaba的easyexcel实现前端使用excel表格批量插入
前端·spring boot·excel
冰暮流星35 分钟前
css3新增背景图片样式
前端·css·css3
书唐瑞1 小时前
谷歌浏览器和火狐浏览器对HTML的嗅探(Sniff)能力
前端·html
rocky1911 小时前
谷歌浏览器插件 使用 playwright 回放用户动作键盘按键特殊处理方案
前端
rocky1911 小时前
playwright里兼容处理回放无界微前端内iframe内部元素事件和不在无界微前端内的iframe元素
前端
rocky1911 小时前
谷歌浏览器插件 使用 playwright 回放slide 拖动动作
前端
惺忪97982 小时前
回调函数的概念
开发语言·前端·javascript
前端 贾公子2 小时前
Element Plus组件v-loading在el-dialog组件上使用无效
前端·javascript·vue.js
天外飞雨道沧桑2 小时前
JS/CSS实现元素样式隔离
前端·javascript·css·人工智能·ai
程序0072 小时前
前端写一个密码登录,验证码登录,注册模板
前端