NPM警告“没有存储库字段".但我没有资料库 [英] NPM Warns "No Repository Field" but I don't have a repository

查看:117
本文介绍了NPM警告“没有存储库字段".但我没有资料库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在家中使用没有存储库的node.js,只是在乱搞.但是,当我运行 npm install 时,会收到 No Repository Field (无存储库字段)警告,如本

I'm using node.js at home without a repository, just mucking around. But when I run npm install, I get the No Repository Field warning as discussed in this other question thread.

npmjs.org用两个示例描述了这个新的package.json字段假设我的仓库在git或svn中,而我的仓库都不在.我现在还没有使用存储库.我可以使用什么值?

npmjs.org describes this new package.json field with two examples assuming my repository is in either git or svn, but mine is in neither. I'm not using a repository just yet. What values can I use?

我尝试了空字符串,空值,甚至将Repository对象留空.

I tried empty strings, null values, and even leaving the Repository object empty.

推荐答案

据我所知,您可以在package.json中指定"private": true,一些警告将被关闭.但是您不能将此类程序包发布到npm注册表.

As far as I remember, you can specify "private": true in your package.json, and some warnings will be turned off. But you can't publish such package to npm registry.

不幸的是,您无法在npm中完全关闭此警告.但是您可以使用 yapm 代替npm,因为这些警告已在该fork中删除(请参阅README).

Unfortunately, you can't turn off this warning in npm completely. But you can use yapm instead of npm, since these warnings are removed in that fork (see it's README).

PS:也就是说,如果您要向npm发布内容,通常最好将代码保留在可公开访问的版本控制系统中

PS: that said, if you're publishing something to npm, it's usually better to keep the code in the publicly accessible version control system

这篇关于NPM警告“没有存储库字段".但我没有资料库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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