1篇 离线 related articles

npm离线安装包及依赖

虚机无法联外网场景下需要安装npm包,找到这个办法:

  1. 在本地安装npm-bundle
    npm install -g npm-bundle

  2. 在本地安装使用npm-bundle下载需要的npm包及依赖,如需要安装json-server, 一个伪server提供api测试场景。https://github.com/typicode/json-server
    npm-bundle json-server, 执行上述命令后会在当前文件目录新建 json-server-0.15.0.tgz

  3. 上传json-server-0.15.0.tgz到虚机中,执行安装
    npm install -g ./json-server-0.15.0.tgz

done.

More ~