Skip to content

npm 源

node version Manage:

sh
pnpm get registry

pnpm config set registry https://registry.npmmirror.com

pnpm config set registry https://registry.npmjs.org/
sh
npm config get registry

npm config set registry https://registry.npmmirror.com

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

npm install --registry https://registry.npmmirror.com
sh
yarn config get registry

yarn config set registry https://registry.npmmirror.com

yarn config set registry https://registry.yarnpkg.com

nvm-windows 淘宝镜像

打开安装目录,默认在 C:\Users\用户名\AppData\Roaming\nvm

打开 settings.txt 然后 添加 淘宝镜像

node_mirror: https://npmmirror.com/mirrors/node/
npm_mirror: https://npmmirror.com/mirrors/npm/

windows 脚本 问题

npm : 无法加载文件 C:\nvm4w\nodejs\npm.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:/go.microsoft.com/fw link/?LinkID=135170 中的 about_Execution_Policies。

管理员 打开 powershell

sh
set-executionpolicy remotesigned

选择 A