如何在没有我自己的注册表的情况下安装私有 NPM 模块? [英] How to install a private NPM module without my own registry?

查看:35
本文介绍了如何在没有我自己的注册表的情况下安装私有 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆