0

I don't understand why my app won't deploy! Is it something to do with the package.json file? am i missing something? any help would be greatly appreciated! My terminal brings up the following error:

Initializing repository, done.
Counting objects: 8405, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (6078/6078), done.
Writing objects: 100% (8405/8405), 90.85 MiB | 726.00 KiB/s, done.
Total 8405 (delta 1988), reused 8183 (delta 1869)

-----> Removing .DS_Store files
-----> Node.js app detected
parse error: Expected another key-value pair at line 10, column 3

 !     Push rejected, failed to compile Node.js app

To git@heroku.com:stormy-brushlands-6191.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:stormy-brushlands-6191.git'

{
  "name": "MotionTherapy",
  "version": "0.0.1",
  "private": "true",
  "dependencies": {
    "express": "3.0.0alpha4",
    "jade": "*",
    "stylus": "*",
    "nib": "*",
  },
  "devDependencies": {},
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "node server.js"
  },
  "author": "Sophie-Plimbley",
  "license": "ISC",
  "engines": {
    "node": "0.10.x"
  },
  "repository": {
    "type": "git",
    "url": "git@heroku.com:stormy-brushlands-6191.git"
  }
}
plimbs
  • 1,459
  • 2
  • 10
  • 12

2 Answers2

1

It's due to the trailing comma on the end of line 10. They're not allowed, as per this answer. The JSON parser expects another 'packagename': 'version' pair, but there is none. The solution is simple: Change this:

"nib": "*",

To:

"nib": "*"
Community
  • 1
  • 1
RickN
  • 12,537
  • 4
  • 24
  • 28
  • Thank you that appears to be it, the app has now been deployed to heroku but on the site it says 'An error occurred in the application and your page could not be served.'do you know what this could be? solve one thing and another pops up! – plimbs May 05 '14 at 12:05
  • the app runs on my machine locally at localhost:3000, do i need to redirect it? @RikkusRukkus – plimbs May 05 '14 at 12:31
  • I'm not a Heroku user, but from what I understand, Heroku only allows you to use a single port and it is not of your own choosing. The allowed port is specified in the environment variable `PORT` (`process.env.PORT`). Try using the [example listed in the FAQ](https://devcenter.heroku.com/articles/getting-started-with-nodejs#write-your-app). – RickN May 05 '14 at 13:04
  • This did not work either, I have a lot of errors in my heroku log such as npm ERR! code ELIFECYCLE? do you know what that is? i am not sure myself, I am going to continue searching around. thanks for your help this far! @RikkusRukkus – plimbs May 05 '14 at 13:34
0

Just FYI if you have not committed all changes (particularly to your package.json file) your git push heroku master command might get this error. That was my problem.

208_man
  • 1,440
  • 3
  • 28
  • 59