记录下前端工程师在windows平台的一些简单初始配置

windows平台

请添加图片描述

nvm-windows

首先去nvm-windows releases页下载安装最新的nvm-windows,这样我们就可以安装我们需要的nodejs

配置终端

打开微软应用商店搜索安装Windows TerminalPrower 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/
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值