npm WARN package.json:没有仓库字段 [英] npm WARN package.json: No repository field

查看:1720
本文介绍了npm WARN package.json:没有仓库字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用以下命令安装了expressjs:

  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没有仓库字段。

新增到nodejs和expressjs。为什么我有上述警告?我应该担心吗?

解决方案

这只是一个NPM v1.2.20的检查,它们报告为警告。 p>

但是,不用担心,还有很多包含存储库的软件包在$ package.json 中的字段。该字段用于提供信息。



如果您是包作者,请将存储库

  package.json  
type:git,
url:git://github.com/username/repository.git
}

详细了解 存储库 字段,并查看记录错误进一步的细节。






另外, 如最初由@dan_nl 报告的,您可以将私人键设置为 package.json

这不仅可以阻止您在应用程序中意外运行 npm publish 但也将停止NPM打印关于 package.json 问题。

  {
name:my-super-amazing-app,
version:1.0.0,
private:true
}


I installed expressjs with the following command:

sudo npm install -g express

I have the following warning:

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.

Im new to nodejs and expressjs. Why 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屋!

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