Npm Install Error - Invalid Package.json
I felt pretty silly for this error I was seeing on one of my project, but lucky for me nothing a good night's sleep couldn't fix. I'm a nite programmer but that sometimes takes it's toll. The first problem was the fact I put an 's' on my file name. It should be "package.json" not "packages.json" which I carelessly did but the second for this error was actually one I think many people run into. Which is syntax, I found my mistake pretty quickly but you could always use online tools to validate your json file or use the pacakge-json-validator package.
//package.json file
Reminder
Since I got my package.json file working correct I thought it was important now to remind myself (and you too!) to add "node_modules" to ignoring-files for my repository.
Resources
package.json - Documentation
node.js - npm install error - invalid package.json - Stack Overflow - Not helpful to my case.
How to write a package.json file - Stack Overflow
//package.json file
{
"name": "ducksauce",
"description": "Web Application Tool",
"dependencies" : {
"open" : "*", <-- Here is the problem!
},
"version" : "0.1.0",
"author" : "Anthony Fassett <XXXXXX@gmail.com>",
"keywords" : [
"app",
"tool"
],
"repository" : "git://github.com/fassetar/ducksauce",
"license" : "MIT"
}
Reminder
Since I got my package.json file working correct I thought it was important now to remind myself (and you too!) to add "node_modules" to ignoring-files for my repository.
Resources
package.json - Documentation
node.js - npm install error - invalid package.json - Stack Overflow - Not helpful to my case.
How to write a package.json file - Stack Overflow