一、到官网下载安装包
1.官网地址:https://nodejs.cn/download/
2.点击全部安装包下载
二、配置环境变量
三、测试是否安装成功
1.按下win+R键盘,输入cmd,运行cmd
2.输入:node -v //显示node.js版本
npm -v //显示npm版本
3.npm config set prefix ''你的路径\node_global''
npm config set prefix "D:\ProgramFiles\node-v11.0.0-win-x64\node_global"
npm config set cache ''你的路径\node_cache''
npm config set cache "D:\ProgramFiles\node-v11.0.0-win-x64\node_cache"
4.安装淘宝镜像
npm config set registry https://registry.npm.taobao.org
5.npm config ls 查看下
6.安装cnpm
我这里报错了
我卸载重装安装
npm uninstall -g cnpm //卸载
npm install cnpm@7.1.0 -g//重新安装
四、检查是否安装成功
cnpm -v