vue项目windows环境初始化

下载nodejs zip包并加载到环境变量

nodejs的版本最好使用12版,而不是最新版


npm install webpack -g
npm install -g yarn
yarn config set registry https://registry.npm.taobao.org

npm install -g cnpm --registry=https://registry.npm.taobao.org

接下来是vue-cli的安装,由于vue已经分出了2与3,这里采用本地安装

cd C:eclipseappvue2

npm install vue-cli

系统变量里新建,将将%VUE2_BIN%添加到用户path中

VUE2_BIN

C:eclipseappvue2 ode_modules.bin

项目初始化 

C:eclipsewksvue>vue init webpack esql-ui
? Project name esql-ui
? Project description A Vue.js project
? Author tanpengfei
? Vue build standalone
? Install vue-router? Yes
? Use ESLint to lint your code? No
? 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) yarn

 如果terminal没有识别到windows的环境变量,确定环境变量配置好后,重启一下IDE

 安装Python27,这是因为vue的一些安装包需要通过python27进行安装

默认安装路径是 C:Python27python.exe,不要修改这个默认路径,vue的包如果发生环境变量中没有时,会直接去这个路径中找



原文地址:https://www.cnblogs.com/perfei/p/13973990.html