'Problems deploying a React/Node-app to Heroku

I am trying to deploy to Heroku but I get this error: "react-scripts: not found". It runs just perfectly in local host. I have the structure of one frontend-folder with React and a backend-folder with Node. I have this package.json i the root to connect the both:

 "scripts": {
"server": "node ./back-end/server.js ",
"client": "npm start --prefix front-end",
"start": "concurrently \"npm run server\" \"npm run client\"",
"heroku-postbuild": "npm install && npm run build --prefix front-end",
"lint": "eslint . --ext .ts"
  },

It seems like heroku cant read the --prefix and that is why it can't reach the frontend-folder. This is my script folder in the frontend (the react-app):

"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},

I really appreciate some help here!!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source