windows 通过 nvm 安装 node

下载最新的 nvm-windows

通过 github 下载

https://github.com/coreybutler/nvm-windows/releases/latest

下载 nvm-setup.zip 安装包版本

安装

1、解压,然后运行 nvm-setup.exe

2、同意,然后 next

3、选择 nvm 安装路径

4、选择 nodejs 安装路径

5、Install 安装

配置 nvm 环境

1、cmd 运行命令,查看 nvm 是否安装成功

nvm version

2、使用淘宝镜像

修改 nvm 安装目录下 settings.txt 文件

添加

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

安装 node

1、查看可以版本

cmd 输入

nvm list available

其中 LTS 为稳定版,建议安装

2、安装 nodejs

cmd 运行

nvm install <版本号>

如果安装失败请手动安装 nodejs

网址:https://registry.npmmirror.com/binary.html?path=node/

选择要安装的版本

下载 zip 版,x64 是 64 为系统使用,x86 为 32 位系统使用

找的 nvm 安装目录,新建文件夹

v<版本号>

将下载的文件解压到新建的文件夹

3、使用 node

1、查看已经安装的 node 版本

nvm list

2、使用 node

运行命令

nvm use <版本号>

3、npm 永久使用淘宝镜像

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

4、修改npm缓存目录

npm config set cache "D:\npm-cache"

posted @ 2024-01-30 16:23  空巷一人  阅读(167)  评论(0编辑  收藏  举报