如何在windows下搭建Vue10.x开发环境
1.安装node.js
https://nodejs.org/dist/v14.15.0/
注:阿里云镜像进去下载安装包
2.设置node的全局和缓存路径
2.1:在安装文件目录下新建两个文件夹放入ynode_global全局模块存放的路径和node_cache缓存路径
3.安装淘宝镜像
npm install -g cnpm --registry=https://registry.npm.taobao.org
4.设置环境变量
设置环境变量的目的就是在任何目录都可以执行node和vue命令。
Classpath:下增加D:\nodejs\node_global
新建NODE_PATH,值D:\nodejs\node_modules
5.安装Vue
5.1需要先关上命令行窗口。再次打开cmd,执行安装vue命令:
cnpm install vue -g
6.安装Vue-cli脚手架
npn install -g [email protected]
安装报错时,执行如下命令更新:
npm i npm -g
npm i @vue/cli -g
cnpm i @vue/cli -g
7.创建一个vue项目
vue create first
cd first
npm run serve
以下就是vue搭建成功:
http://localhost:8080/
%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\ ;