NPM压缩包版安装

1.下载

镜像参考 ​​阿里巴巴开源镜像站​

npm镜像 ​​中国 NPM 镜像 (npmmirror.com)​

2、解压缩

将文件解压到要安装的位置,并在解压的位置新建两个目录

node-global :npm全局安装位置

node-cache:npm 缓存路径

3.配置环境变量(例如解压的为D:\npm)

添加:path(用户级别):


+ D:\npm
+ D:\npm\node-global

NPM压缩包版安装_缓存NPM压缩包版安装_缓存

4.设置下载和缓存目录:


npm config set prefix "D:\npm\node-global"
npm config set cache "D:\npm\node-cache"

NPM压缩包版安装_缓存NPM压缩包版安装_缓存

5.安装cnpm

npm install -g cnpm --registry=https://registry.npm.taobao.org