npm离线安装
npm离线安装
Section titled “npm离线安装”想使用pm2来管理进程,但因为线上环境不能访问外网,又没有内部源。因此就想看看npm能否离线安装包。
使用npm-bundle
Section titled “使用npm-bundle”npm-bundle可以将一个包及其依赖全部打包成一个.tgz文件。
先在联网环境安装npm-bundle
npm install -g npm-bundle然后打包pm2
npm-bundle pm2上述名称会生成一个tgz的包文件,复制这个文件到线上环境安装即可。
npm install -g ./pm2-3.2.2.tgz