I have just completed my MVP for a MERN app and have deployed to Heroku. I am following the deployment tutorial from: https://dev.to/hawacodes/deploying-a-mern-app-with-heroku-3km7
The deployment is fine, however the app starts then crashes with the following log:
2022-02-28T14:33:52.129152+00:00 app[web.1]: > ygo-n-sample-hand@1.0.0 start
2022-02-28T14:33:52.129152+00:00 app[web.1]: > concurrently --kill-others-on-fail "npm run server" "npm run start --prefix sample-front"
2022-02-28T14:33:52.129153+00:00 app[web.1]:
2022-02-28T14:33:52.140525+00:00 app[web.1]: sh: 1: concurrently: not found
2022-02-28T14:33:52.350800+00:00 heroku[web.1]: State changed from starting to crashed
My scripts from package.json looks like this,
"scripts": {
"build-sample-front": "cd sample-front && npm run build",
"install-sample-front": "cd sample-front && npm install",
"heroku-postbuild": "npm run install-sample-front && npm run build-sample-front",
"server": "nodemon app.js",
"dev": "concurrently --kill-others-on-fail \"npm run server\" \"npm run start --prefix sample-front\"",
"start": "concurrently --kill-others-on-fail \"npm run server\" \"npm run start --prefix sample-front\""
},
My dependencies, defined in package.json is as follows:
"dependencies": {
"connect-mongodb-session": "^3.1.1",
"cors": "^2.8.5",
"dotenv": "^16.0.0",
"ejs": "^3.1.6",
"express": "^4.17.3",
"express-session": "^1.17.2",
"mongoose": "^6.2.2",
"node-fetch": "^3.2.0"
},
"devDependencies": {
"nodemon": "^2.0.15"
}
At first I did not have the npm module: concurrently installed. I then installed it, but get the same problem. Any help is appreciated.
I installed the npm concurrently module in the wrong place. I ran npm install concurrently in the root of my express server app.js