How to solve the npm WARN package.json: No repository field
In this tutorial, we are going to learn about how to fix the npm warn No repository field
warning in the Node project.
When we initialize a package.json
file in the node project and trying to install an npm package using npm install <package-name>
command, we will encounter this type of warnings in our terminal.
➜ node-app npm install express
npm WARN node-app@1.0.0 No repository field.
This warning tells us, there is no repository field in our project.
To fix this warning, add a private: true
to your package.json
file
{
"name": "node-app",
"version": "1.0.0",
"private": "true",
}
In case, if you have a plan to publish this project as an npm
package then you need to add a actual GitHub repository location (where your code lives) to the package.json
file.
"repository": {
"type": "git",
"url" : "https://v8.googlecode.com/svn/trunk/"
}