Npm sounds like a great platform to use within an organization, curious if a private repo is possible, like with Nexus/Maven. Nothing comes up on Google :(

推荐答案

I don't think there is an easy way to do this.

A look at the npm documentation tells us, that it is possible:

Can I run my own private registry?

Yes!

The easiest way is to replicate the couch database, and use the same (or similar) design doc to implement the APIs.

If you set up continuous replication from the official CouchDB, and then set your internal CouchDB as the registry config, then you'll be able to read any published packages, in addition to your private ones, and by default will only publish internally. If you then want to publish a package for the whole world to see, you can simply override the --registry config for that command.

There's also an excellent tutorial on how to create a private npm repository in the clock blog.

EDIT (2017-02-26):

Not really new, but there are now paid plans to host private packages on npm.

Over the years, npm has become a factor for many non-Node.js companies, too, through the huge frontend ecosystem that's built upon npm. If your company is already running Sonatype Nexus for hosting Java projects internally, you can also use it for hosting internal npm packages.

Other options include JFrog Artifactory and Inedo ProGet, but I haven't used those.

Node.js相关问答推荐

在Android Studio中react 本机构建失败:未正确检测到Node.js版本

在Node JS中获取控制台选项卡标题

即使卷已设置,Docker Nodemon 也不会热重载

NodeJS:zlib.gzipSync 在不同平台上给出不同的明文输出

如何在Node.js的telegraf.js命令中添加参数?

如何在 Firestore 函数上使用类型模型来获取字段值

我误解了外键的工作原理吗?使用续集

为什么要加密 CSRF 令牌?

Axios 响应循环通过函数只返回第一个映射对象的结果

在express js模型中将js转换为Typescript 时Typescript 错误

fs.writefile 选项参数的可能值,尤其是只读文件的整数

突然 React 无法执行create-react-app命令.为什么会发生这种情况,我该如何解决?

baseurl64 缓冲区解码

如何申请在NextJS上下载文件的许可?

Handlebars:访问已被拒绝解析来自的属性,因为它不是其父级的自己的属性

错误:大多数中间件(如 bodyParser)不再与 Express Bundle

TypeError:请求路径包含未转义的字符,我该如何解决这个问题

npm install 给出警告,npm audit fix 不起作用

expressjs app.VERB 调用中的 next() 和 next('route') 有什么区别?

Cordova 无法加载 platformapi