Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

npm WARN package.json [email protected] No repository field

Tags:

git

node.js

npm

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 [email protected] No repository field.
npm WARN package.json [email protected] 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?

like image 432
Pablo Avatar asked Dec 01 '15 12:12

Pablo


People also ask

Why NPM install is not working?

The Npm command not found error can appear when you install or upgrade npm. On Windows, the cause of this error could be that a PATH or system variable is not correctly set. The error can also occur if you do not have npm or Node. js installed, have an outdated version, or have permission issues.

What does NPM warn mean?

The npm WARN deprecated message means that the package installed on your project is not recommended for use. This may be due to issues found with the package or it's no longer maintained. You may not even see these packages in your package. json file because they are dependencies of the packages that you are using.


2 Answers

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.

like image 164
rjmunro Avatar answered Sep 19 '22 20:09

rjmunro


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

{
  "name": "Stock",
  "version": "1.0.1",
  "private": true
}
like image 22
Abhishek Goel Avatar answered Sep 21 '22 20:09

Abhishek Goel