@vue/cli 4.5.3 安装过程
一、准备
采用淘宝镜像,下载速度快
npm config set registry https://registry.npm.taobao.org
二、全局安装新版vue cli
cnpm install @vue/cli -g
三、因为需要sass,所以在需要生成项目的目录下执行如下命令,注意此处的目录不是项目目录,而是其父目录
3.1
cnpm install --global --production windows-build-tools //安装一次即可
3.2 npm i node-sass --sass_binary_site=https://npm.taobao.org/mirrors/node-sass/
执行后会出现“node_modules”目录和package-lock.json文件
否则会出现“Error: Can't find Python executable "python", you can set the PYTHON env variable”
四、生成项目,并选择手动配置
在当前目录执行 vue create shieh
4.1
4.2 选择如下内容
4.3
4.4 输入“y”
4.6
4.7
4.8
4.9
4.10 输入“n”
完整的输出如下:
Vue CLI v4.5.3 ✨ Creating project in D:\work\web\vue\shieh. � Initializing git repository... ⚙️ Installing CLI plugins. This might take a while... > yorkie@2.0.0 install D:\work\web\vue\shieh\node_modules\yorkie > node bin/install.js setting up Git hooks done > core-js@3.6.5 postinstall D:\work\web\vue\shieh\node_modules\core-js > node -e "try{require('./postinstall')}catch(e){}" > ejs@2.7.4 postinstall D:\work\web\vue\shieh\node_modules\ejs > node ./postinstall.js added 1241 packages from 919 contributors in 103.849s 50 packages are looking for funding run `npm fund` for details � Invoking generators... � Installing additional dependencies... > node-sass@4.14.1 install D:\work\web\vue\shieh\node_modules\node-sass > node scripts/install.js Cached binary found at C:\Users\Administrator\AppData\Roaming\npm-cache\node-sass\4.14.1\win32-x64-72_binding.node > node-sass@4.14.1 postinstall D:\work\web\vue\shieh\node_modules\node-sass > node scripts/build.js Binary found at D:\work\web\vue\shieh\node_modules\node-sass\vendor\win32-x64-72\binding.node Testing binary Binary is fine added 147 packages from 100 contributors in 19.235s 56 packages are looking for funding run `npm fund` for details ⚓ Running completion hooks... � Generating README.md... � Successfully created project shieh. � Get started with the following commands: $ cd shieh $ npm run serve WARN Skipped git commit due to missing username and email in git config. You will need to perform the initial commit yourself.