Open ahauser16 opened 2 years ago
Hi! I faced with the same problem and solved it by changing Node version (including engines params in my package.json). This is my package.json:
{ "name": "server", "version": "1.0.0", "description": "", "main": "index.js", "engines": { "node": "16.3.0", "npm": "8.5.4" }, "scripts": { "start": "node index.js", "server": "nodemon index.js", "client": "npm run start --prefix client", "dev": "concurrently \"npm run server\" \"npm run client\"", "heroku-postbuild":"NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client" }, "author": "", "license": "ISC", "dependencies": { "bcryptjs": "^2.4.3", "concurrently": "^5.3.0", "cookie-parser": "^1.4.6", "cookie-session": "^1.4.0", "cors": "^2.8.5", "express": "^4.18.1", "mongoose": "^5.13.14", "nodemon": "^2.0.4", "passport": "^0.4.1", "passport-google-oauth20": "^2.0.0", "passport-local": "^1.0.0", "passport-youtube-v3": "^2.1.0" } }
I hope this helps :)
The error occurs when I try to deploy the application to git and push to Heroku. When I follow these steps Heroku is supposed to automatically install all of the project's server-side dependencies which is caused by a 'heroku-postbuild' script in the server-side-folder JSON package. After Heroku runs all of the server's dependencies, it is supposed to automatically run a 'heroku-postbuild' script that instructs Heroku to (1) install all of the client-side dependencies in the client-side-folder JSON package and then (2) run the command 'npm run build' from within the client-folder directory. After these steps Heroku is supposed to try to start the application but I get the error below. FYI--I followed the directions within the error message but they didn't work. I've also tried to install eslint as a dependency in both JSON packages which hasn't made a difference for better or for worse.
This is the full error from my console:
This is my Heroku Build Log:
This is my package.json file in the client-side folder directory:
This is my package.json file in the server-side folder directory: