简体   繁体   English

如何创建包含软件包及其依赖项的NPM存储库

[英]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.

相关问题 使用 npm 如何将包下载为 zip 包,其中包含包中包含的所有依赖项 - Using npm how can I download a package as a zip with all of its dependencies included in the package 如何将下载的npm依赖项发布到私有本地存储库? - How can I publish downloaded npm dependencies to a private local repository? 如何找到由NPM软件包的某个依赖项安装的二进制文件,以便可以执行它? - How do I locate a binary installed by one of my NPM package's dependencies so I can execute it? 我可以在npm package.json中指定可选的模块依赖项吗? - Can I specify optional module dependencies in npm package.json? 预先构建的NPM软件包:如何使用户摆脱依赖关系? - Pre-built NPM package: How can I spare users my dependencies? 从 git 存储库安装 npm package 时可以跳过一些依赖项吗? - Can you skip some dependencies when installing an npm package from a git repository? 如何在NPM中表达替代依赖关系? - How can I express alternative dependencies in NPM? 如何安装 npm 依赖项目? - how can i install npm dependencies project? 使用NPM安装软件包时,您能告诉它使用其依赖项之一的不同版本吗? - When installing a package with NPM, can you tell it to use a different version of one of its dependencies? 如何创建我可以包含的npm包并在父项目中运行该包? - How to create npm package that I can include and run that package in the parent project?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM