Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

problem parsing package.json

I keep getting this error when I try to install a new npm package, but I don't know what the error would be. Does anyone see anything wrong with the json here?

{ "name": "flashcards", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": [], "author": "", "license": "ISC", "dependencies": { "express": "^4.15.2", "pug": "^2.0.0-rc.4" }

JSONLint tells me this but I don't really understand the error. Error: Parse error on line 15: ...g": "^2.0.0-rc.4" } ----------------------^ Expecting '}', ',', got 'EOF'

Thanks, J

3 Answers

Hi J,

You're missing a closing curly bracket at the end of the file.

{
    "name": "flashcards", 
    "version": "1.0.0", 
    "description": "", 
    "main": "index.js", 
    "scripts" : 
        { 
        "test": "echo \"Error: no test specified\" && exit 1" 
        }, 
    "keywords": [], 
    "author": "", 
    "license": "ISC", 
    "dependencies": 
        { 
        "express": "^4.15.2", 
        "pug": "^2.0.0-rc.4" 
    }
}

Thanks for the help Tom it's always just a dumb error that stumps me.

Hi, package is a JSON file extension, you must obey the syntax, closing all curly braces and put comma to every end value of properties.