简体   繁体   English

将所有依赖项发布到本地npm注册表

[英]Publishing all dependencies to local npm registry

I would like to create local npm registry with sinopia and then publish there all packages from my projects node_modules directory. 我想用sinopia创建本地npm注册表,然后在其中将我的项目的node_modules目录中的所有软件包发布到那里。 Effectively I want to be able to run npm install --registry="http://localhost:4873" in my project offline and get all the needed dependencies from local registry. 实际上,我希望能够在我的项目中脱机运行npm install --registry="http://localhost:4873" ,并从本地注册表获取所有需要的依赖项。 Is there a simple way of doing this? 有一个简单的方法吗?

sinopia will cache registries that it pulls from npmjs.org by default. 默认情况下, sinopia将缓存从npmjs.org的注册表。

If you set up your registry to use your sinopia one, then do a clean npm install (delete node_modules prior to running it) through it (while sinopia is connected to the internet), it should pull down all of the packages from npmjs.org and cache them. 如果您将注册表设置为使用您的sinopia,则通过它进行干净的npm install (在运行它之前删除node_modules )(当sinopia连接到Internet时),它应该从npmjs.org下拉所有软件包。并缓存它们。

After that, subsequent calls with sinopia disconnected should use the one it has cached locally and work as intended. 在那之后,sinopia断开的后续呼叫应使用已本地缓存并按预期工作的呼叫。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM