npm WARN package.json:没有存储库字段 [英] npm WARN package.json: No repository field
问题描述
我使用以下命令安装了 Express.js:
sudo npm install -g express
我收到以下警告:
npm WARN package.json range-parser@0.0.4 没有存储库字段.npm WARN package.json fresh@0.1.0 没有存储库字段.npm WARN package.json methods@0.0.1 没有存储库字段.npm WARN package.json methods@0.0.1 没有自述数据.npm WARN package.json cookie-signature@1.0.1 没有存储库字段.npm WARN package.json send@0.1.0 没有存储库字段.npm WARN package.json pause@0.0.1 没有存储库字段.npm WARN package.json bytes@0.2.0 没有存储库字段.npm WARN package.json github-url-from-git@1.1.1 没有存储库字段.npm WARN package.json assert-plus@0.1.2 没有存储库字段.npm WARN package.json ctype@0.5.2 没有存储库字段.
我是 Node.js 和 Express.js 的新手.为什么我有上述警告?我应该担心吗?
这只是 NPM v1.2.20 的检查,他们将此报告为警告.
不过,别担心,sooooooo 很多包的 package.json
中仍然没有 repository
字段.该字段用于提供信息.
如果您是包作者,请将 repository
放在您的 package.json
中,如下所示:
存储库":{类型":git",url":git://github.com/username/repository.git"}
此外, 最初由@dan_nl 报告,您可以设置 private
键入您的 package.json
.
这不仅会阻止你在你的应用中意外运行 npm publish
,还会阻止 NPM 打印关于 package.json
问题的警告.
{名称":我的超级惊人的应用程序",版本":1.0.0",私人":真实}
I installed Express.js with the following command:
sudo npm install -g express
I get the following warnings:
npm WARN package.json range-parser@0.0.4 No repository field.
npm WARN package.json fresh@0.1.0 No repository field.
npm WARN package.json methods@0.0.1 No repository field.
npm WARN package.json methods@0.0.1 No readme data.
npm WARN package.json cookie-signature@1.0.1 No repository field.
npm WARN package.json send@0.1.0 No repository field.
npm WARN package.json pause@0.0.1 No repository field.
npm WARN package.json bytes@0.2.0 No repository field.
npm WARN package.json github-url-from-git@1.1.1 No repository field.
npm WARN package.json assert-plus@0.1.2 No repository field.
npm WARN package.json ctype@0.5.2 No repository field.
I'm new to Node.js and Express.js. Why do I have the above warnings? Should I be worried?
It's just a check as of NPM v1.2.20, they report this as a warning.
However, don't worry, there are sooooooo many packages which still don't have the repository
field in their package.json
. The field is used for informational purposes.
In the case you're a package author, put the repository
in your package.json
, like this:
"repository": {
"type": "git",
"url": "git://github.com/username/repository.git"
}
Read more about the repository
field, and see the logged bug for further details.
Additionally, as originally reported by @dan_nl, you can set private
key in your package.json
.
This will not only stop you from accidentally running npm publish
in your app, but will also stop NPM from printing warnings regarding package.json
problems.
{
"name": "my-super-amazing-app",
"version": "1.0.0",
"private": true
}
这篇关于npm WARN package.json:没有存储库字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!