Error message might be caused by missing package.json file. Change directory to your project’s local directory, as an example (instead, use current working directory of your project):
cd /var/www/nodeBot
Following string will write package.json:
npm init
Answer menu-driven questions or use --yes to blast past them. Then press enter at the end to write out the file. You might see something like:
Wrote to /usr/local/bin/package.json:
{
"name": "bin",
"version": "1.0.0",
"description": "",
"main": "index.js",
"dependencies": {
"twit": "^2.1.1"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"
}
npm is node.js‘s package manager. package.json becomes npm‘s configuration or settings file. The twit dependency was a program installed into my project dir. npm install twit
If a package.json file exists in your project’s directory, you can use a text editor to fill in empty data fields that can also cause error messages.
Find the description field in the package.json file and manually add a description:
"description": "This is my latest disruptive technology app.",
In license field you can add ISC which basically means open source project:
"license": "ISC"