node.js – npm WARN package.json: No repository field
node.js – npm WARN package.json: No repository field
Its just a check as of NPM v1.2.20, they report this as a warning.
However, dont worry, there are sooooooo many packages which still dont have the repository
field in their package.json
. The field is used for informational purposes.
In the case youre 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
}
you can also mark the application as private if you don’t plan to put it in an actual repository.
{
name: my-application,
version: 0.0.1,
private: true
}
node.js – npm WARN package.json: No repository field
As dan_nl stated, you can add a private fake repository in package.json. You dont even need name and version for it:
{
...,
repository: {
private: true
}
}
Update: This feature is undocumented and might not work. Choose the following option.
Better still: Set the private
flag directly. This way npm doesnt ask for a README file either:
{
name: ...,
description: ...,
version: ...,
private: true
}