so basically whenever I try to push to Heroku, or I try to run npm run build it would goes into infinite loop like this:
> projectname@1.0.0 build
> cd frontend && npm run build
in the terminal, i have a react app which has a package.json (let's call it inner package), and a package.json in the project folder level (let's call it outer package),
inner package code:
{
"name": "my-app",
"version": "0.1.0",
"private": true,
"engines": {
"node": "16.x"
},
"dependencies": {
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.3.0",
"@testing-library/user-event": "^13.5.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^5.2.0",
"react-scripts": "5.0.1",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
outer package.json:
{
"name": "cise_ass1a_worksheet3",
"version": "1.0.0",
"description": "",
"main": "app.js",
"engines": {
"node": "16.x"
},
"scripts": {
"test": "echo "Error: no test specified" && exit 1",
"build": "cd frontend && npm run build",
"install-app": "cd frontend && npm install",
"heroku-postbuild": "npm run install-app && npm run build",
"app": "nodemon app.js",
"develop": "concurrently --kill-others-on-fail "npm run app" "npm run start --prefix client"",
"start": "concurrently --kill-others-on-fail "npm run app" "npm run start --prefix client""
},
"author": "Ghazi",
"license": "ISC",
"dependencies": {
"bcryptjs": "^2.4.3",
"body-parser": "^1.20.0",
"config": "^3.3.7",
"cors": "^2.8.5",
"express": "^4.18.1",
"mongoose": "^6.5.1",
"validation": "^0.0.1"
},
"devDependencies": {
"nodemon": "^2.0.19"
}
}