vue2.9.6的脚手架的搭建

946 阅读1分钟

一.下载vue2.0版本

运行npm install -g vue-cli命令搭建环境!

二.用webpack创建项目

运行命令vue init webpack my-project

? Project name my-project

? Project description A Vue.js project

? Author zwj <**************>

? Vue build standalone

? Install vue-router? Yes

? Use ESLint to lint your code? Yes

? Pick an ESLint preset Standard

? Set up unit tests No

? Setup e2e tests with Nightwatch? No

? Should we run npm install for you after the project has been created? (recommended) npm

三.cd 进当前项目目录,然后npm run dev运行项目

四.sass命令的配置

npm install node-sass --save-dev

npm install sass-loader --save-dev

但我出现了 Module build failed: TypeError: this.getResolve is not a function at Object.loader (/Users/apple/Desktop/NewTactics-Manager-Frontend/node_modules/sass-loader/dist/index.js:52:26)

检查和搜索一下是因为sass版本是8.0过高导致的错误,所以我

npm uninstall sass-loader(卸载当前版本)

 npm install sass-loader@7.3.1 --save-dev  解决了这个问题!

五.下载axios配置全局的api.js

运行命令npm install axios -S

至此完结!新人小白,请各位大牛方正!