Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

heroku error: Expected another key-value pair

Tags:

node.js

heroku

I am trying to deploy a nodejs app to heroku for the first time, following heroku's instructions here

When I run git push heroku master, it starts compiling the app, but when it reaches 100% and I get this

parse error: Expected another key-value pair at line 18, column 1

 !     Push rejected, failed to compile Node.js app

To [email protected]:agile-sands-7020.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to '[email protected]:agile-sands-7020.git'

I have created new keys with ssh-keygen -t rsa and added them to heroku with heroku keys:add but I still get this error. Can someone help me please?

like image 567
Roman Epicnerd Sharf Avatar asked Feb 17 '14 02:02

Roman Epicnerd Sharf


1 Answers

Ah, I figured it out, this mysterious error has to do with the package.json file. Basically I botched the "engines" field by declaring it in a seperate json object

{
  "name": "elegant-insults",
  "version": "0.0.0",
  "description": "Insult eachother in the most elegant of ways",
  "main": "server.js",
  "dependencies": {
    "socket.io": "~0.9.16",
    "xml2js": "~0.4.1",
    "express": "~3.4.8"
  },
  "devDependencies": {},
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "node server.js"
  },
  "author": "roman-sharf",
  "license": "ISC",
  "repository": {
    "type": "git",
    "url": "[email protected]:elegant-insults.git"
  }
},
{
"engines": {
    "node": "0.10.x"
  }
}

instead it should be like this:

{
  "name": "elegant-insults",
  "version": "0.0.0",
  "description": "Insult eachother in the most elegant of ways",
  "main": "server.js",
  "dependencies": {
    "socket.io": "~0.9.16",
    "xml2js": "~0.4.1",
    "express": "~3.4.8"
  },
  "devDependencies": {},
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "node server.js"
  },
  "author": "roman-sharf",
  "license": "ISC",
  "engines": {
    "node": "0.10.x"
  },
  "repository": {
    "type": "git",
    "url": "[email protected]:elegant-insults.git"
  }
}
like image 71
Roman Epicnerd Sharf Avatar answered Sep 28 '22 22:09

Roman Epicnerd Sharf