vuejs3.0 从入门到精通——vue3创建项目的时候卡顿,比较慢
vue3 创建项目的时候卡顿,比较慢
使用 vue3 命令 vue create vue3-element-plus-admin 创建项目时,一直出现卡顿,导致无法创建项目,如下:
解决办法:
1、检查 npm 源:
//查看源,可以看到设置过的所有的源 $ npm config get registry
2、设置 npm 源:
//设置淘宝源 $ npm config set registry https://registry.npm.taobao.org
3、再次查看 npm 源:
$ npm config get registry https://registry.npm.taobao.org
4、再次执行 vue create vue3-element-plus-admin:
zuoyang@DESKTOP-FAR4VD9 MINGW64 /d/worker-vue3 $ vue create vue3-element-plus-admin Vue CLI v5.0.8 ? Target directory D:\worker-vue3\vue3-element-plus-admin already exists. Pick an action: Overwrite Removing D:\worker-vue3\vue3-element-plus-admin... Vue CLI v5.0.8 ? Please pick a preset: Default ([Vue 3] babel, eslint) Vue CLI v5.0.8 ✨ Creating project in D:\worker-vue3\vue3-element-plus-admin. 🗃 Initializing git repository... ⚙️ Installing CLI plugins. This might take a while... added 862 packages in 3m 🚀 Invoking generators... 📦 Installing additional dependencies... added 103 packages in 2m ⚓ Running completion hooks... 📄 Generating README.md... 🎉 Successfully created project vue3-element-plus-admin. 👉 Get started with the following commands: $ cd vue3-element-plus-admin $ npm run serve