如何在没有我自己的注册表的情况下安装私有NPM模块? [英] How to install a private NPM module without my own registry?
本文介绍了如何在没有我自己的注册表的情况下安装私有NPM模块?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经获取了一些共享代码并将其放在NPM模块中,我不想将其上传到中央注册表.问题是,如何从其他项目中安装它?
I've taken some shared code and put it in an NPM module, one I don't want to upload to the central registry. The question is, how do I install it from other projects?
最明显的方法可能是设置我自己的NPM注册表,但是根据文档,这涉及很多麻烦.
The obvious way is probably to set up my own NPM registry, but according to the documentation, that involves a lot of hassle.
我可以仅安装一个位于本地文件系统上的NPM模块,甚至可以从git中安装该模块吗?
Can I just install an NPM module that sits on the local filesystem, or perhaps even from git?
npm install --from-git git@server:project
推荐答案
cd somedir
npm install .
或
npm install path/to/somedir
somedir
必须在其中包含package.json
.
它也了解git:
npm install git://github.com/visionmedia/express.git
这篇关于如何在没有我自己的注册表的情况下安装私有NPM模块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文