1.下载node包,并设置环境变量
1.在node官网下载和自己电脑相匹配的node包,并安装,直接都是下一步就好
2.安装好后,在设置——系统——系统高级设置中增加NODE-PATH变量,路径为node在电脑中的安装地址
2.全局下载webpack,webpack-cli,webpack-dev-server
npm install -g webpack
npm install -g webpak-cli
npm install -g webpack-dev-server
3.全局下载vue,vue-cli
npm install -g vue
npm install -g vue-cli
4.项目构建
构建webpack项目
npm init -y
构建vue项目
vue init webpack
这样一个完整的目录就可以构建出来了
5.遇到的报错信息
The operation was rejected by your operating system.
npm ERR! It’s possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
这是因为权限问题导致的
用管理员身份运行cmd就可以解决这个问题