fancy fancy - 2 months ago 6x
JSON Question

What needs to change in this package.json file to work with npm 0.3.0?

Trying to use a lib but getting this error...

npm ERR! JSON.parse Failed to parse package.json data.
npm ERR! JSON.parse Note that package.json must be actual JSON, not
npm ERR! JSON.parse just a JavaScript object.
npm ERR! JSON.parse
npm ERR! JSON.parse This changed in npm 0.3.0, and is not a bug in npm.
npm ERR! JSON.parse Tell the package author to fix their package.json file.

Not sure what changes are likely needed to make it valid JSON, thanks very much!


Valid JSON must have both keys and values of an object in quotes. Surround all of your keys in quotation marks and that should make the error go away.

Reference: JSON spec

Update: I did the dirty work for you. Let me know if this fixes it.

{ "name": "embedly"
, "version": "0.3.2"
, "description": "Embedly client library for node"
, "homepage": ""
, "keywords": []
, "author":
  { "name": "Bob Corsaro"
  , "email": ""
  , "url": ""
, "repository":
  { "type": "git"
  , "url": "git://"
, "bugs": { "web": "" }
, "directories":
  { "doc": "./docs"
  , "lib": "./lib"
  , "test": "./test"
, "dependencies": {"hashish": "", "qs": ""}
, "devDependencies": {"vows": ">= 0.5.6"}
, "main": "./lib/embedly.js"
, "scripts": { "test": "vows" }
, "bin":
  { "embedly_oembed": "bin/embedly_oembed.js"
  , "embedly_objectify": "bin/embedly_objectify.js"
  , "embedly_preview": "bin/embedly_preview.js"