Geurts
Geurts

Reputation: 213

NPM Warns "No Repository Field" but I don't have a repository

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 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?

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

Upvotes: 11

Views: 2753

Answers (2)

Jerônimo Awotwi
Jerônimo Awotwi

Reputation: 251

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.

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: that said, if you're publishing something to npm, it's usually better to keep the code in the publicly accessible version control system

Upvotes: 13

Peter Lyons
Peter Lyons

Reputation: 146124

You should probably just ignore the warning and get on with your life.

However, you can also try npm config set loglevel error.

You could of course just set it to a bogus value such as:

"repository" :
  { "type" : "git"
  , "url" : "http://example.com"
  }

Upvotes: 0

Related Questions