美文网首页
offline npm

offline npm

作者: 前端张果冻 | 来源:发表于2017-05-15 10:42 被阅读0次

原文地址

You use npm install & pack

First on a machine that is online you install

$ npm install pm2

Then you pack it up

$ npm pack pm2

That gives you a tar file -- you copy that tar file to your offline machine and install, like

$ npm install pm2-2.2.1.tgz

The above however only create a tarball for the specific module expluding dependencies, and you may still have dependencies that you need to resolve. While you could simply walk through and pack every dependency manually, there is a modules that will automated that for you

$ npm install -g npm-bundle

Then you can do

$ npm-bundle pm2

for the individual packages, or if you have apackage.jsonfor your project

$ npm-bundle

to pack everything in one big tarball

相关文章

网友评论

      本文标题:offline npm

      本文链接:https://www.haomeiwen.com/subject/ezacxxtx.html