1.安装vscode
2.安装git bash
- 2.1在系统应用中以管理员身份运行git bash 或者git bash所在文件夹中双击打开git-cmd.exe
- 2.2清空所有用户名和密码:git config --system --unset credential.helper
- 2.3.先输git config --global user.email “你的邮箱号”
- 2.4.再输git config --global user.name “账号名”
- [
局部配置,针对具体项目,在项目目录下运行命令:
git config user.name "worker95"
git config user.email "worker95@work.com"
全局配置:
git config --global user.name "user95"
git config --global user.email "user95@foxmail.com"
]- 2.5 补充 如果不想每次输入用户和密码(可以使用git config --global credential.helper store,这样再获取代码提示输入用户名和密码,输入之后后续就不需要再次输入了。)
- 2.6淘宝镜像 :npm install -g cnpm --registry=http://registry.npmmirror.com
- 2.5 补充 如果不想每次输入用户和密码(可以使用git config --global credential.helper store,这样再获取代码提示输入用户名和密码,输入之后后续就不需要再次输入了。)
- 2.3.先输git config --global user.email “你的邮箱号”
- 2.2清空所有用户名和密码:git config --system --unset credential.helper
-
3.安装yarn
- 3.1vscode命令行中 npm install -g yarn
- (这个安装成功后有目录 找到bin C:\Users\Administrator\AppData\Local\Yarn\bin)
- 3.2配置path中的环境变量
- 3.3yarn config set registry xxxxxx (看是否需要配置)
- 3.4重启vscode
-
4.在vscode中无法使用yarn
- 4.1 在vscode终端中使用 get-ExecutionPolicy
- 4.2显示Restricted(不可用,继续操作)
- 4.3输入 set-ExecutionPolicy RemoteSigned
- 4.4输入 set-ExecutionPolicy –Scope CurrentUser
- 4.5设置: RemoteSigned
- 4.6重启vscode
-
5.host 文件地址 C:\Windows\System32\drivers\etc
-
# Copyright (c) 1993-2009 Microsoft Corp. # # This is a sample HOSTS file used by Microsoft TCP/IP for Windows. # # This file contains the mappings of IP addresses to host names. Each # entry should be kept on an individual line. The IP address should # be placed in the first column followed by the corresponding host name. # The IP address and the host name should be separated by at least one # space. # # Additionally, comments (such as these) may be inserted on individual # lines or following the machine name denoted by a '#' symbol. # # For example: # # 102.54.94.97 rhino.acme.com # source server # 38.25.63.10 x.acme.com # x client host # localhost name resolution is handled within DNS itself. # ::1 localhost 127.0.0.1 localhost localhost 127.0.0.1 #127.0.0.1 wxp.56pay.net 配置可以参考这个 127.0.0.1 view-localhost # view localhost server
- 4.5设置: RemoteSigned
- 4.4输入 set-ExecutionPolicy –Scope CurrentUser
- 4.3输入 set-ExecutionPolicy RemoteSigned
- 4.2显示Restricted(不可用,继续操作)
- 4.1 在vscode终端中使用 get-ExecutionPolicy
- 3.3yarn config set registry xxxxxx (看是否需要配置)
- 3.2配置path中的环境变量
yarn 其他常遇问题:
1.yarn : 无法加载文件 C:\Program Files\nodejs\yarn.ps1,因为在此系统上禁止运行脚本
cmd 下执行 Set-ExecutionPolicy -Scope CurrentUser
输入 remotesigned