卸载:
- 1、控制面板卸载、或者卸载更改程序卸载
- 2、删除node.js的环境变量
- 3、检查是否有一下文件夹,删除
C://user/xxx/node_models
C://Program Fiels/nodejs
C://user/xxx/AppData/Roaming/npm
C://user/xxx/AppData/Roaming/npm-cache
1、下载
- 进入下载地址
- 根据系统选择下载,zip是压缩文件,mis是可运行安装包。也可以选择以前版本
- 如果选择其他版本,可以根据选择下载。
2、安装
- 点击msi启动安装
- 接受条款、next
- 选择安装路径、可以修改到其他硬盘下。
- 配置环境变量中
- 一路向前
- 安装完成
3、配置路径
配置npm在安装全局模块时的路径和缓存cache的路径(因为默认占据C盘)
- 在node.js安装目录下新建两个文件夹 node_global和node_cache
npm config set prefix D:\node\node_globle (node_global文件地址)
npm config set cashe D:\node\node_cache (node_cache文件地址)
- 环境变量的系统变量中新建一个变量名为
NODE_PATH
, 值为安装目录中node_modules地址 - 编辑用户变量里的Path,将其中默认的C:\Users\用户名\AppData\Roaming\npm更改为
node_global
的地址
4、 npm 配置镜像
- 配置镜像:
npm config set registry https://registry.npmmirror.com
- 原本默认:
npm config set registry https://registry.npmjs.org
- 查看:
npm config get registry