我正在尝试构建和部署 Meteor 项目。我的限制是我必须在没有互联网的本地网络的远程计算机上部署应用程序,因此 npm install 不需要连接到任何地方。
我的想法是使用 shrinkwrap 和 shrinkpack,如下所述: https ://guide.meteor.com/using-npm-packages.html#npm-shrinkpack
然后按照此处所述进行构建: https ://docs.meteor.com/commandline.html#meteorbuild
我在开发盒上做什么:
meteor npm shrinkwrap // this properly updates the npm-shrinkwrap.json
meteor npm shrinkpack // this properly populates the \node_shrinkwrap folder with the tars of the dependencies
meteor --production
//terminate meteor
meteor build ..\build // I cannot find the tars for the dependencies in the output
然后我将 tarball 复制到远程计算机:
tar -zxf coolMeteorAngular2App.tar.gz
cd bundle\programs\server
npm install // still connects to internet to get the dependencies instead of getting the from the local bundle
node main.js
有谁知道我做错了什么?如何将依赖项 tarball 包含到构建中,以及如何告诉 npm install 使用它们?