开发环境搭建(Windows)
安装 Git
下载地址:https://git-scm.com/downloads
打开git bash 执行如下命令:
查看git版本:git --version
配置本地git:
请将下面命令按实际情况进行执行
git config --global user.name "Your Name"
git config --global user.email "Your Email"
安装 node.js
下载地址:https://nodejs.org/en/download/
在window命令行终端(win+r键cmd)
查看node版本:node -v
查看npm版本:npm -v
安装 yarn
npm是node.js的包管理工具(package manager),node.js安装中包含npm的安装,故使用npm来安装yarn
在window命令行终端(win+r键cmd)输入:
npm install yarn -g
查看yarn版本:
yarn -v
安装 eslint
在项目中采用eslint语法检查工具,所以需要全局安装eslint
$ npm install eslint -g
或者使用yarn安装
$ yarn global add eslint
查看版本
# eslint -v
安装vscode
下载地址:https://code.visualstudio.com/
vscode中配置git
- 打开vs code 文件–首选项–设置–输入框中搜索git.path
- 打开setting.json文件
然后添加这两行,注意git.path后面的路径是你自己安装git的路径
找到Git/bin/git.exe然后复制填到git.path后面 记住是反斜杠
"files.autoSave": "afterDelay",
"git.path": "D:/xxxx/Git/bin/git.exe"
- 配置window下cmd中git
右键“计算机”->“属性”->“高级系统设置”->“环境变量”->在下方的“系统变量”中找到“path”->选中“path”并选择“编辑”->添加安装路径(D:\xxxx\Git\bin;)保存,退出
配置好了之后打开cmd输入git,会有关于git的信息表示安装成功