3

Ao executar o comendo:

git push heroku master

LOG:

-----> Node.js app detected

parse error: Unfinished string

!     Unable to parse package.json

-----> Build failed



We're sorry this build is failing! You can troubleshoot common issues here:

https://devcenter.heroku.com/articles/troubleshooting-node-deploys

If you're stuck, please submit a ticket so we can help:

https://help.heroku.com/

Love,

Heroku


!     Push rejected, failed to compile Node.js app.

!     Push failed

Arquivo package.json

{
  "name": "application-name",
  "version": "0.0.1",
  "description": "Contatos com NodeJS",
  "engines": {
    "node": "6.10.2",
    "npm": "3.10.10"
  },
  "scripts": {
    "start": "node app.js",
  },
  "dependencies": {
    "bcrypt-nodejs": "0.0.3",
    "body-parser": "~1.0.0",
    "cookie-parser": "~1.0.1",
    "debug": "~0.7.4",
    "express": "~4.0.0",
    "express-flash": "0.0.2",
    "express-load": "^1.1.15",
    "express-session": "latest",
    "express-validator": "^3.2.0",
    "jade": "~1.3.0",
    "moment": "^2.18.1",
    "mongoose": "^4.9.6",
    "morgan": "~1.0.0",
    "nodemailer": "^4.0.1",
    "static-favicon": "~1.0.0"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/mariojbe/contatos_NodeJS"
  },
  "keywords": [
    "node",
    "heroku",
    "express"
  ],
  "license": "MIT"
}

1 Resposta 1

2

O erro retornado é bem claro

Unable to parse package.json

Ou seja, o arquivo package.json está inválido.

Veja no atributo scripts, tem o atributo start, o valor dele e depois uma vírgula, remova a vírgula.

Você sempre pode fazer uso de algumas ferramentas pra validar isso. Eu usei o JSONLint.

"scripts": {
   "start": "node app.js"
},

Arquivo completo

{
  "name": "application-name",
  "version": "0.0.1",
  "description": "Contatos com NodeJS",
  "engines": {
    "node": "6.10.2",
    "npm": "3.10.10"
  },
  "scripts": {
    "start": "node app.js"
  },
  "dependencies": {
    "bcrypt-nodejs": "0.0.3",
    "body-parser": "~1.0.0",
    "cookie-parser": "~1.0.1",
    "debug": "~0.7.4",
    "express": "~4.0.0",
    "express-flash": "0.0.2",
    "express-load": "^1.1.15",
    "express-session": "latest",
    "express-validator": "^3.2.0",
    "jade": "~1.3.0",
    "moment": "^2.18.1",
    "mongoose": "^4.9.6",
    "morgan": "~1.0.0",
    "nodemailer": "^4.0.1",
    "static-favicon": "~1.0.0"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/mariojbe/contatos_NodeJS"
  },
  "keywords": [
    "node",
    "heroku",
    "express"
  ],
  "license": "MIT"
}

Você deve fazer log-in para responder a esta pergunta.

Esta não é a resposta que você está procurando? Pesquise outras perguntas com a tag .