
封面
nvm-windows
首先去nvm-windows releases页下载安装最新的nvm-windows,这样我们就可以安装我们需要的nodejs了
配置终端
打开微软应用商店搜索安装Windows Terminal和Prower Shell, 然后用管理员模式执行Set-ExecutionPolicy RemoteSigned -Scope CurrentUser:让操作系统可以执行powershell脚本。
git
在prowershell中使用winget安装即可:winget install --id Git.Git,然后配置:
# 配置名字和email
git config --global user.name xxx
git config --global user.email xxx
# 配置记住密码
git config --global credential.helper store
# 配置别名
git config --global alias.a add
git config --global alias.br branch
git config --global alias.su status
git config --global alias.pl pull
git config --global alias.ps push
git config --global alias.co checkout
starship
我本人比较喜欢用starship来配置终端,同样使用winget来安装:winget install --id Starship.Starship,然后notepad $PROFILE打开配置文件输入:
Invoke-Expression (& 'C:\Program Files\starship\bin\starship.exe' init powershell --print-full-init | Out-String)
重启终端即可。
激活pnpm并且换源
假设我们已经安装好nvm-windows并且安装了nodejs(v16+)了
# 开启corepack
corepack enable
# 看下pnpm是否已经可用,如果不可用再去执行corepack prepare pnpm@latest --activate激活
pnpm -v
# 更换taobao源
pnpm config set registry https://registry.npmmirror.com/