I made a portfolio with Reactjs and a little bit of nodejs to implement nodemailer, and now I'm trying to deploy to heroku but I'm getting this error: ! [remote rejected] main -> main (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/dedaportfolio.git
I'm trying everthing but it seems nothing working, I did a lot of research around but nothing worked to me Here is the error when I'm trying to push to heroku
Enumerating objects: 38099, done.
Counting objects: 100% (38099/38099), done.
Delta compression using up to 8 threads
Compressing objects: 100% (28232/28232), done.
Writing objects: 100% (38099/38099), 98.10 MiB | 108.00 KiB/s, done.
Total 38099 (delta 8542), reused 38081 (delta 8535), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
remote: -----> Determining which buildpack to use for this app
remote: -----> Node.js app detected
remote:
remote: -----> Creating runtime environment
remote:
remote: NPM_CONFIG_LOGLEVEL=error
remote: NODE_VERBOSE=false
remote: NODE_ENV=production
remote: NODE_MODULES_CACHE=true
remote:
remote: -----> Installing binaries
remote: engines.node (package.json): 16.15.0
remote: engines.npm (package.json): 7.24.2
remote:
remote: Resolving node version 16.15.0...
remote: Downloading and installing node 16.15.0...
remote: Bootstrapping npm 7.24.2 (replacing 8.5.5)...
remote: npm 7.24.2 installed
remote:
remote: -----> Installing dependencies
remote: Installing node modules (package.json)
remote:
remote: added 89 packages, and audited 90 packages in 8s
remote:
remote: 12 packages are looking for funding
remote: run `npm fund` for details
remote:
remote: 1 critical severity vulnerability
remote:
remote: To address all issues (including breaking changes), run:
remote: npm audit fix --force
remote:
remote: Run `npm audit` for details.
remote:
remote: -----> Build
remote: Detected both "build" and "heroku-postbuild" scripts
remote: Running heroku-postbuild
remote:
remote: > myportfolio@1.0.0 heroku-postbuild
remote: > cd client && npm install && npm install --only=dev --no-shrinkwrap && npm run build
remote:
remote:
remote: up to date, audited 1466 packages in 3s
remote:
remote: 194 packages are looking for funding
remote: run `npm fund` for details
remote:
remote: 7 high severity vulnerabilities
remote:
remote: To address issues that do not require attention, run:
remote: npm audit fix
remote:
remote: To address all issues (including breaking changes), run:
remote: npm audit fix --force
remote:
remote: Run `npm audit` for details.
remote:
remote: added 64 packages, removed 188 packages, changed 281 packages, and audited 1342 packages in 27s
remote:
remote: 207 packages are looking for funding
remote: run `npm fund` for details
remote:
remote: 6 high severity vulnerabilities
remote:
remote: To address all issues (including breaking changes), run:
remote: npm audit fix --force
remote:
remote: Run `npm audit` for details.
remote:
remote: > frontend@0.1.0 build
remote: > react-scripts build
remote:
remote: sh: 1: react-scripts: Permission denied
remote:
remote: -----> Build failed
remote:
remote: We're sorry this build is failing! You can troubleshoot common issues here:
remote: https://devcenter.heroku.com/articles/troubleshooting-node-deploys
remote:
remote: If you're stuck, please submit a ticket so we can help:
remote: https://help.heroku.com/
remote:
remote: Love,
remote: Heroku
remote:
remote: ! Push rejected, failed to compile Node.js app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to dedaportfolio.
remote:
To https://git.heroku.com/dedaportfolio.git
! [remote rejected] main -> main (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/dedaportfolio.git'
this the package.json in the root of my project
{
"name": "myportfolio",
"version": "1.0.0",
"engines": {
"node": "16.15.0",
"npm":"7.24.2"
},
"description": "",
"main": "index.js",
"scripts": {
"client": "cd client && npm start",
"server": "nodemon server.js",
"build": "cd client && npm run build",
"dev":"concurrently --kill-others-on-fail \"npm run server\" \"npm run client\"",
"start": "node server.js",
"heroku-postbuild": "cd client && npm install && npm install --only=dev --no-shrinkwrap && npm run build"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"cors": "^2.8.5",
"dotenv": "^16.0.1",
"express": "^4.18.1",
"nodemailer": "^4.7.0"
},
"devDependencies": {
"concurrently": "^7.3.0"
}
}
This is my client package.json
{
"name": "client",
"version": "0.1.0",
"engines": {
"node": "16.15.0"
},
"private": true,
"dependencies": {
"@fortawesome/free-brands-svg-icons": "^6.1.2",
"@fortawesome/free-solid-svg-icons": "^6.1.2",
"@fortawesome/react-fontawesome": "^0.2.0",
"@testing-library/react": "^13.3.0",
"@testing-library/user-event": "^13.5.0",
"axios": "^0.27.2",
"bootstrap": "^5.2.0",
"framer-motion": "^7.0.0",
"react": "^18.2.0",
"react-bootstrap": "^2.4.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.3.0",
"react-scripts": "^5.0.1",
"react-scroll": "^1.8.7",
"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"
]
}
}