首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Vue创建“projectName”ERR_SOCKET_TIMEOUT -无论如何都会失败-淘宝

Vue创建“projectName”ERR_SOCKET_TIMEOUT -无论如何都会失败-淘宝
EN

Stack Overflow用户
提问于 2021-03-17 07:19:59
回答 1查看 1.4K关注 0票数 1

最近发生在我身上的事情让我有点困惑。

每当我想要创建一个新的vue项目时,它都会失败,因为:

代码语言:javascript
复制
Vue CLI v4.5.11
✨  Creating project in /home/admin/Documents/dev/my_projects/vThesaurus/thesaurus.
⚙️  Installing CLI plugins. This might take a while...

npm ERR! code ERR_SOCKET_TIMEOUT
npm ERR! errno ERR_SOCKET_TIMEOUT
npm ERR! request to https://registry.npm.taobao.org/jsonfile failed, reason: Socket timeout

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/admin/.npm/_logs/2021-03-17T06_40_10_793Z-debug.log
ERROR  command failed: npm install --loglevel error --legacy-peer-deps

prev尝试的另一个包:

代码语言:javascript
复制
request to https://registry.npm.taobao.org/core-js-compat failed, reason: Socket timeout
request to https://cdn.npm.taobao.org/micromatch/-/micromatch-4.0.2.tgz failed, reason: Socket timeout
request to https://registry.npm.taobao.org/querystring-es3 failed, reason: Socket timeout
request to https://registry.npm.taobao.org/file-loader failed, reason: Socket timeout

…还有更多

日志:(最后一部分)

代码语言:javascript
复制
4675 timing command:install Completed in 378261ms
4676 verbose type system
4677 verbose stack FetchError: request to https://registry.npm.taobao.org/jsonfile failed, reason: Socket timeout
4677 verbose stack     at ClientRequest.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/minipass-fetch/lib/index.js:97:14)
4677 verbose stack     at ClientRequest.emit (events.js:315:20)
4677 verbose stack     at TLSSocket.socketErrorListener (_http_client.js:463:9)
4677 verbose stack     at TLSSocket.emit (events.js:327:22)
4677 verbose stack     at emitErrorNT (internal/streams/destroy.js:100:8)
4677 verbose stack     at emitErrorCloseNT (internal/streams/destroy.js:68:3)
4677 verbose stack     at processTicksAndRejections (internal/process/task_queues.js:84:21)
4678 verbose cwd /home/admin/Documents/dev/my_projects/vThesaurus/thesaurus
4679 verbose Linux 5.4.0-67-generic
4680 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--loglevel" "error" "--legacy-peer-deps"
4681 verbose node v14.2.0
4682 verbose npm  v7.6.3
4683 error code ERR_SOCKET_TIMEOUT
4684 error errno ERR_SOCKET_TIMEOUT
4685 error request to https://registry.npm.taobao.org/jsonfile failed, reason: Socket timeout
4686 verbose exit 1
the weirdest part is that it always fails on a different package …

我试过:

  • 若要删除nodejs和vue,请重新安装,但没有执行…
  • 增加~/.npmrc中的超时,但再次失败,…(我没有缓慢的互联网连接- ping 3ms,d: 96 96Mbps,u: 9.6 96Mbps)
  • 我在互联网上发现的任何东西似乎都没有用,…。
  • 更改IP (nordvpn)以到达不同的服务器(CDN),但没有运气
  • vue2和vue3以相同的故障告终(总是随机包故障)。
  • 手动访问失败的包--你猜怎么着,它很好用。
  • 尝试在{ "useTaobaoRegistry": false }…中添加~/.vimrc又没运气了
  • 尝试过不同的网络提供商..。没有运气:(

…似乎什么都没起作用

npm -v 7.6.3

vue --版本 @vue/cli 4.5.11

操作系统:Ubuntu20.04.2LTS 64位

Gnome版本: 3.36.8

我遗漏了什么?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-03-19 16:12:15

看起来你确实对淘宝有特别的意见。从这个github螺纹,我们可以尝试不再使用它。

为此,您可以转到您的~/.vuerc并设置"useTaobaoRegistry": false

yarn config get registry给了我https://registry.yarnpkg.com

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66668568

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档