7

I have a project in a personal private git, I downloaded in another computer and when trying to download the packages in packages.json i got this error message:

pablo@debian:~/Documents/clients/stock$ npm install
npm WARN package.json Stock@0.0.1 No repository field.
npm WARN package.json Stock@0.0.1 No README data

This is the content of the packages.json

{
  "name": "Stock",
  "version": "0.0.1",
  "description": "Stock App",
  "devDependencies": {
    "grunt": "~0.4.5",
    "grunt-contrib-watch": "^0.6.1",
    "grunt-execute": "^0.2.2",
    "socket.io": "latest",
    "mysql": "latest",
    "express": "latest",
    "path": "latest",
    "express-session": "latest",
    "cookie-parser": "latest",
    "ejs": "latest"
  },
  "dependencies": {
    "socket.io": "~1.3.7",
    "body-parser": "~1.14.1"
  }
}

What can I do, to packages to download, and why in my other computer I don't get this error?

CodeWizard
  • 128,036
  • 21
  • 144
  • 167
Pablo
  • 9,424
  • 17
  • 55
  • 78
  • 3
    http://stackoverflow.com/questions/16827858/npm-warn-package-json-no-repository-field They are warnings, not errors. – Sverri M. Olsen Dec 01 '15 at 12:45
  • Yes I found that, but I dont get why I need a github repository, I dont have one – Pablo Dec 01 '15 at 12:46
  • Does this answer your question? [npm WARN package.json: No repository field](https://stackoverflow.com/questions/16827858/npm-warn-package-json-no-repository-field) – Henke Jun 30 '21 at 12:47

4 Answers4

12

These warnings are just warnings, and don't indicate anything reason that the dependencies would not have downloaded.

The package.json file shown is working perfectly for me. To debug your issue, try removing the node_modules folder and running npm install again. Note that if the packages are already in the node_modules folder, npm install won't download them again.

If you want to fix the warnings:

  1. Before devDependencies, add a repository option; i.e. something like:

      "repository": {
        "type": "git",
        "url": "[git-url-of-your-project]"
      },
    

    The URL doesn't have to be a github one, just whatever you use to git clone the project on another computer.

  2. Add a file called README or README.md and write a few words about what the project is in it.

rjmunro
  • 27,203
  • 20
  • 110
  • 132
  • why I need a repository for my project? – Pablo Dec 01 '15 at 12:49
  • @Pablo You don't. You can just ignore the warning. But you mention in the question that you have one, so you may as well document it. – rjmunro Dec 01 '15 at 12:53
  • ok, so the problem is other then, since the dependencies are not downloading. There is a way I can check for that? – Pablo Dec 01 '15 at 12:54
  • Yes, sorry, misunderstood the point of your question. Try removing the node_modules folder if you have one and running npm install again. – rjmunro Dec 01 '15 at 12:56
8

Mark your application as private to suppress all warnings by adding "private": true

{
  "name": "Stock",
  "version": "1.0.1",
  "private": true
}
Abhishek Goel
  • 18,785
  • 11
  • 87
  • 65
0

I found removing the node_modules folder and doing 'npm install' from fresh seemed to fix my issues.

Sprose
  • 1,255
  • 1
  • 16
  • 20
0

Just add your package.json file from

C:\Program Files\nodejs\node_modules\npm 

to

C:\Windows\System32 

and everything will be fine and working. Hope it helps.

Tim Diekmann
  • 7,755
  • 11
  • 41
  • 69
Swaruuu
  • 41
  • 3