NPM警告“没有存储库字段".但我没有资料库

编程入门 行业动态 更新时间:2024-10-18 10:32:00
本文介绍了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用两个示例描述了这个新的package.json字段假设我的仓库在git或svn中,而我的仓库都不在.我现在还没有使用存储库.我可以使用什么值?

npmjs 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警告“没有存储库字段".但我没有资料库

本文发布于:2023-10-24 14:13:09,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1524155.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:但我   字段   资料库   NPM   quot

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!