Reputation: 1
I'm new to nodejs, I tried typing npm install and it brought this error log:
npm warn saveerror ENOENT: no such file or directory,
open C:\users\kiddy\package.json
npm WARN kiddy no description
npm WARN kiddy no repository field
Npm WARN kiddy no README data
How do I overcome above error?
Upvotes: 0
Views: 1357
Reputation: 8227
and welcome to NodeJS. Hope this little issue hasn't deterred you, and hopefully by now you have overcome this challenge and moved on your NodeJS journey. But in spirit of sharing knowledge, here is what had happened.
As your npm install
script indicated, you have not provided description
and repository
fields, and you don't have a README.md
file.
The easiest way to create a new package.json
is to run the npm init command
.
npm init --yes
Here is a sample package.json file to get you started. Best of luck!!
{
"name": "my_package",
"description": "Awesome NodeJS project.",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://github.com/ashleygwilliams/my_package.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/ashleygwilliams/my_package/issues"
},
"homepage": "https://github.com/ashleygwilliams/my_package"
}
Upvotes: 0
Reputation: 21
Before installing any packages with the npm install command, you have to have a package.json. Use this in the folder
npm init
Now, you can install packages.
Upvotes: 0