Tuesday, 21 May 2019

Heroku - bash: node: command not found. Process error code 127

I am struggling with the problem that I am not able to deploy my node application to the Heroku. Previously I have done it several times and everything was working like a charm. Now I encounter bash: node: command not found. I have no idea what to do to get rid of this problem.

My Procfile:

web: node ./src/index.js

My package.json:

{
  "name": "scheduler_be",
  "version": "1.0.0",
  "description": "",
  "main": "./src/index.js",
  "scripts": {
    "test": "jest --forceExit",
    "start": "nodemon ./src/index.js --development"

  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/jablonskipj/scheduler-be.git"
  },
  "author": "Patryk Jablonski",
  "license": "ISC",
  "bugs": {
    "url": "https://github.com/jablonskipj/scheduler-be/issues"
  },
  "homepage": "https://github.com/jablonskipj/scheduler-be#readme",
  "dependencies": {
    "body-parser": "^1.19.0",
    "express": "^4.16.4",
    "jest": "^24.1.0",
    "knex": "^0.16.5",
    "node": "^12.2.0",
    "node-cron": "^2.0.3",
    "nodemon": "^1.18.9",
    "npm": "^6.9.0",
    "pg": "^7.8.0",
    "pg-hstore": "^2.3.2",
    "smsapi": "^1.5.7"
  },
  "engines": {
    "node": "12.2.0"
  }
}

and my index.js:

const express = require('express')
const reminderRoutes = require('./routes/Routes')
const bodyParser = require('body-parser')

const PORT = process.env.PORT || 8006

console.log(PORT)

const app = express()

app.use(bodyParser.json())
app.use('/reminder', reminderRoutes)


app.listen(PORT, () => {
  console.log(`app listening on port ${PORT}`)
})

I have tried to log out anything valuable by using heroku logs -t but this does not give me anything more than Process error code 127.

Can anyone help me with this problem?

I have tried things suggested in the heroku node.js bash: node: command not found but nothing helped. That question was asked 7 years ago and never answered, so I am pretty sure that my problem is different here.

Is there anyone from the Heroku team that could help me with the problem? Recently I have tried to force the use of the npm in version 6.5.0 and this has no effect. I have read the whole https://devcenter.heroku.com/articles/troubleshooting-node-deploys and applied all of the suggestions. How can I force Heroku to give me more info about what is exactly the problem?

EDIT:

I have also tried without the Procfile and app still does not work. Now I receive bash: npm: command not found so I am getting pretty frustrated, because of that I have another Nodejs app deployed on the Heroku and it is deploying without a problem.

EDIT:

I have checked for multiple times and the buildset is heroku/nodejs. Is there anything else that I can do to deploy this app to the heroku somehow?



from Heroku - bash: node: command not found. Process error code 127

No comments:

Post a Comment