目录
一.下载安装
官网:
https://nodejs.org/en/download
下载完之后,安装的时候一直点next即可,也可以根据自己的需求进行勾选
二.环境变量的配置

创建如上两个文件夹
然后打开环境变量
复制node.js的路径
例如我的是:C:\Program Files\Java\node-v18.18.0-win-x64


然后找到系统变量的path

%NODE_HOME%\
%NODE_HOME%\node_cache
%NODE_HOME%\node_global
点击确定
验证环境变量是否配置成功
打开cmd

如果出现npm 或者 node 不是内部命令也不是外部命令的话一般就是环境变量配置没有成功
三.设置全局路径和缓存路径

npm config set prefix " xxxxxxxxxxxxxxxxx\node_global"
npm config set cache " xxxxxxxxxxxxxxxxx\node_cache"
四.配置淘宝镜像
npm config set registry https://registry.npm.taobao.org

五.查看配置
npm config ls

六.使用npm安装cnpm
npm install -g cnpm
点击node_global

可以查看到有这些文件生成
使用cnpm -v查看版本信息
