最近发生在我身上的事情让我有点困惑。
每当我想要创建一个新的vue项目时,它都会失败,因为:
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-depsprev尝试的另一个包:
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…还有更多
日志:(最后一部分)
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 …我试过:
~/.npmrc中的超时,但再次失败,…(我没有缓慢的互联网连接- ping 3ms,d: 96 96Mbps,u: 9.6 96Mbps){ "useTaobaoRegistry": false }…中添加~/.vimrc又没运气了…似乎什么都没起作用
npm -v 7.6.3
vue --版本 @vue/cli 4.5.11
操作系统:Ubuntu20.04.2LTS 64位
Gnome版本: 3.36.8
我遗漏了什么?
发布于 2021-03-19 16:12:15
看起来你确实对淘宝有特别的意见。从这个github螺纹,我们可以尝试不再使用它。
为此,您可以转到您的~/.vuerc并设置"useTaobaoRegistry": false。
yarn config get registry给了我https://registry.yarnpkg.com。
https://stackoverflow.com/questions/66668568
复制相似问题