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?
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"
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With