[英]How can I create an NPM repository containing a package and its dependencies
I have a system that is offline that I need to airdrop a couple of npm packages into, including their dependencies. 我有一个离线系统,需要将一些npm软件包(包括它们的依赖项)空投到其中。 I've tried several solutions for picking an npm package and packaging up it and all of its dependencies into a tarball to be transferred to the offline system, but none even come close to working thus far.
我已经尝试了几种解决方案,以选择一个npm软件包并将其及其所有依赖项打包到一个tarball中,以传输到脱机系统,但是到目前为止,甚至没有一个解决方案能够正常工作。 A quick effective solution would be great.
快速有效的解决方案将是非常不错的。
Have you tried the most obvious thing? 您是否尝试过最明显的事情?
#!/bin/bash
mkdir drop
cd drop
npm i $1
cd ..
tar -zcvf drop.tar.gz drop
After comprehensively trying every top solution recommended by Google, I eventually discovered npmbox, which works like a charm. 在全面尝试了Google推荐的每一个顶级解决方案之后,我最终发现了npmbox,它的工作原理很有吸引力。
https://github.com/arei/npmbox https://github.com/arei/npmbox
A bit of useful guidance when interacting with the node community, whether in #node.js on freenode or here on StackOverflow: https://blog.npmjs.org/post/163421115230/shutting-down-npm-irc 与节点社区进行交互时的一些有用指导,无论是在freenode上的#node.js中还是在StackOverflow上的此处: https ://blog.npmjs.org/post/163421115230/shutting-down-npm-irc
There is a general pattern of not reading questions carefully and putting down the person answering them. 通常的模式是不仔细阅读问题并拒绝回答问题。 Just ignore those folks.
只是忽略那些人。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.