NVS 下载与安装
Windows 离线安装:详见官方项目 https://github.com/jasongin/nvs 的 Release
Windows 在线安装:PowerShell 命令 winget install jasongin.nvs
NVS 换源
Windows 下,NVS 默认的安装路径为 %USERPROFILE%\AppData\Local\nvs(自动加入环境变量)。
将其中的 default.json 文件备份为 default - Copy.json ,修改 default.json 内容如下:(换清华源)
1 2 3 4 5 6 7 8 9
| { "aliases": { }, "remotes": { "default": "node", "node": "https://mirrors.tuna.tsinghua.edu.cn/nodejs-release/" }, "bootstrap": "node/16.20.2" }
|
文件夹导航栏输入 cmd 打开控制台窗口,安装最新的 Node.js 长期支持版本:
NPM 换源
- 在控制台中,切换到特定版本的 Node.js ;
- 将该版本的 NPM 源换为镜像源;(这里以淘宝源为例)
1
| npm config set registry https://registry.npmmirror.com
|
- 来到活动目录,安装需要的包;(
--verbose 选项用于查看安装的详细情况)
- 通过 NPX 运行包。如:
参考资料