设置淘宝源

npm

npm config set registry https://registry.npm.taobao.org

yarn

yarn config set registry https://registry.npm.taobao.org

设置全局下载目录

npm

npm config set prefix "D:\nodejs\npm\global"
npm config set cache "D:\nodejs\npm\cache"

yarn

yarn config set global-folder "D:\nodejs\yarn\global"
yarn config set cache-folder "D:\nodejs\yarn\cache"
yarn config set prefix "D:\nodejs\yarn\bin"

win10 PowerShell yarn 无法识别问题

  1. 确保环境变量Path设置无误
  2. 超管打开PowerShell 输入命令 确定
    Set-ExecutionPolicy RemoteSigned

zpfei
186 声望7 粉丝

往事如风~