vue搭建项目参考
搭建vue项目
参考链接:https://blog.csdn.net/weixin_46002631/article/details/124395689
确认安装了nodejs
安装vue-cli,初始化项目
1、使用以下命令全局安装vue-clinpm install -g vue-cli 或者使用国内的淘宝镜像npm install -g cnpm --registry=https://registry.npm.taobao.org
碰到问题1:
npm ERR! code EEXIST
npm ERR! path D:\A_web\A_Nodejs14.19\node_global\node_modules\vue-cli\bin\vue
npm ERR! dest D:\A_web\A_Nodejs14.19\node_global\vue
npm ERR! EEXIST: file already exists, cmd shim 'D:\A_web\A_Nodejs14.19\node_global\node_modules\vue-cli\bin\vue' -> 'D:\A_web\A_Nodejs14.19\node_global\vue'
npm ERR! File exists: D:\A_web\A_Nodejs14.19\node_global\vue
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.
原因:vue版本过低
解决方法:
npm install -g @vue/cli - -force
可以强制覆盖以前旧版本的vue-cli脚手架,
如下图:完美解决
检测版本:vue --version
vue --version
@vue/cli 5.0.8
2、使用命令 vue init webpack skp-demo 搭建vue项目, “skp-demo” 是你的项目名称。这里用skp是因为我刚好想仿照skp的主页写一个前端练练手。
我使用的是Vue-CLI 2.x版本。
浙公网安备 33010602011771号