win10 安装 nodejs & npm & cnpm
2019-11-13 本文已影响0人
杨康他兄弟
1,在nodejs官网 http://nodejs.cn/download/ 下载win10对应的安装包,我选择的是64位。

2,下载后安装,一路next,安装完成。
3,安装完成后,在安装目录下新建 node_global , node_cache 两个目录。并且保证这两个目录有完全的读写权限。

4,打开CMD,输入如下命令 npm -v ,如下图所示,说明安装成功。


6,输入如下命令:
#设置node_global
npm config set prefix "D:\Program Files\nodejs\node_global"
#设置node_cache
npm config set cache "D:\Program Files\nodejs\node_cache"
#设置淘宝npm镜像
npm config set registry http://registry.cnpmjs.org
7, 安装cnpm
npm install -g cnpm --registry=https://registry.npm.taobao.org

