Heroku Next JS app push rejected because of Node version - node.js

When trying to push my app to Heroku I am getting the following errors (edited for brevity):
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): >=v12.22.5
remote: engines.npm (package.json): >=6.14.14
remote:
remote: Resolving node version >=v12.22.5...
remote: Could not parse Version Requirements '>=v12.22.5': the given version requirement is invalid
remote: Downloading and installing node 17.0.1...
remote: Bootstrapping npm >=6.14.14 (replacing 8.1.0)...
remote: npm >=6.14.14 installed
My package.json (name redacted):
{
"name": "########",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start -p $PORT"
},
"engines": {
"node": "16.13.0"
},
"dependencies": {
"#stripe/react-stripe-js": "^1.4.1",
"#stripe/stripe-js": "^1.15.0",
"#zeit/next-css": "^1.0.0",
"axios": "^0.21.4",
"base-64": "^1.0.0",
"bootstrap": "^4.6.0",
"cookie": "^0.4.1",
"date-and-time": "^1.0.0",
"js-cookie": "^2.2.1",
"next": "^11.1.2",
"react": "17.0.2",
"react-bootstrap": "^1.5.2",
"react-calendar": "^3.3.1",
"react-datepicker": "^4.2.1",
"react-dom": "17.0.2",
"react-hook-form": "^7.17.4",
"react-icons": "^4.2.0",
"react-image-gallery": "^1.0.9",
"stripe": "^8.154.0"
}
}
... and further down the error trail:
remote: Error: error:0308010C:digital envelope routines::unsupported
remote: at new Hash (node:internal/crypto/hash:67:19)
remote: at Object.createHash (node:crypto:130:10)
remote: at BulkUpdateDecorator.hashFactory (/tmp/build_f62151d1/node_modules/next/dist/compiled/webpack/bundle5.js:138971:18)
remote: at BulkUpdateDecorator.update (/tmp/build_f62151d1/node_modules/next/dist/compiled/webpack/bundle5.js:138872:50)
remote: at /tmp/build_f62151d1/node_modules/next/dist/compiled/webpack/bundle5.js:59321:9
remote: at processTicksAndRejections (node:internal/process/task_queues:83:21)
remote: at runNextTicks (node:internal/process/task_queues:65:3)
remote: at processImmediate (node:internal/timers:437:9) {
remote: opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
remote: library: 'digital envelope routines',
remote: reason: 'unsupported',
remote: code: 'ERR_OSSL_EVP_UNSUPPORTED'
remote: }
remote: Node.js v17.0.1
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: Some possible problems:
remote:
remote: - Dangerous semver range (>) in engines.node
And, at the end of the error messages, I'm not sure if this is a separate error. I changed my master branch to main a while back and I'm not sure if this is also telling me that I may have done this incorrectly (seems fine on GitHub):
remote: Verifying deploy...
remote:
remote: ! Push rejected to #########.
remote:
To https://git.heroku.com/########.git
! [remote rejected] main -> main (pre-receive hook declined)
I have been 'around the houses' on Google trying various and many fixes with no answer that worked. It looks to me as if Heroku is reading the wrong information from my package.json? Many thanks for any replies.

Got some help from Heroku support for this. My problem seemed to match a current use case that's currently out there online but I don't think this is the same. In case anyone else has the same issue I'll put my solutions here.
Heroku build was trying to automatically install version 17 of Node because it didn't understand the 'engines' version I had in my package.json at that time, and Heroku build is not compatible with version 17.x
The version of package.json 'stuck' in Heroku's build
"engines": {
"node": ">=v12.22.5"
},
But I changed that version multiple times during tesing and it seems Heroku didn't notice the changes to package.json. Heroku support told me to run a cache clearance and that worked. Once I ran the cache clearance Heroku build then picked up the correct version of Node from the 'engines' element. Here's how to clear the build cache
Install heroku-builds from the Heroku CLI
heroku plugins:install heroku-builds
Ensure the correct version of Node is on your local machine, but more importantly make sure the correct version is referenced in package.json. I decided on version 16.13.0
"engines": {
"node": "16.13.0"
},
Run the Heroku cache clearance
heroku builds:cache:purge -a example-app
Then redeploy your app. In my case the issue was fixed. Not sure if Heroku agree (and I'm not qualified to argue) but I feel the error in the end was because the cache needed to be cleared.
References:
Clear the build cache:
https://help.heroku.com/18PI5RSY/how-do-i-clear-the-build-cache
Supported Node versions:
https://devcenter.heroku.com/articles/nodejs-support#supported-runtimes

Related

Nodejs: failed to push some refs to 'https://git.heroku.com/myproject.git'

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"
]
}
}
The final three messages here:
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'
are from Git itself and are simply a summary of the fact that Heroku (not Git) didn't like your code. Ignore them entirely as they add no information whatsoever; pay attention only to the remote:-prefixed lines. Git relays these lines to you whenever Heroku tells you why it does not like your code.
The remaining problems are all specific to either Heroku or your code. In this case, the errors come from npm, which is noting:
high severity vulnerabilities
which you should fix because security vulnerabilities are bad, but most importantly, from the next step in the build process:
sh: 1: react-scripts: Permission denied
which simply means that your react-scripts in the stuff you're deploying is wrong, so have a look at that.

Can't deploy React app to Heroku due to webpack

I'm trying to deploy a react app (not Create-react-app), which consist of my own webpack configurations. I can Build the app successfully locally and running locally successfully. But when I push to Heroku, git push heroku master I get the following message:
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Node.js app detected
remote:
remote: -----> Creating runtime environment
remote:
remote: NPM_CONFIG_LOGLEVEL=error
remote: NPM_CONFIG_PRODUCTION=true
remote: YARN_PRODUCTION=true
remote: NODE_ENV=production
remote: NODE_MODULES_CACHE=false
remote: NODE_VERBOSE=false
remote:
remote: -----> Installing binaries
remote: engines.node (package.json): 10.x
remote: engines.npm (package.json): unspecified (use default)
remote: engines.yarn (package.json): 1.x
remote:
remote: Resolving node version 10.x...
remote: Downloading and installing node 10.16.0...
remote: Using default npm version: 6.9.0
remote: Resolving yarn version 1.x...
remote: Downloading and installing yarn (1.16.0)...
remote: Installed yarn 1.16.0
remote:
remote: -----> Restoring cache
remote: Caching has been disabled because NODE_MODULES_CACHE=false
remote:
remote: -----> Installing dependencies
remote: Installing node modules (yarn.lock)
remote: yarn install v1.16.0
remote: [1/4] Resolving packages...
remote: [2/4] Fetching packages...
remote: info fsevents#1.2.9: The platform "linux" is incompatible with this module.
remote: info "fsevents#1.2.9" is an optional dependency and failed compatibility check. Excluding it from installation.
remote: [3/4] Linking dependencies...
remote: [4/4] Building fresh packages...
remote: Done in 18.83s.
remote:
remote: -----> Build
remote: Running build (yarn)
remote: yarn run v1.16.0
remote: $ rm -rf build/ && webpack --env.mode production
remote:
remote: Insufficient number of arguments or no entry found.
remote: Alternatively, run 'webpack(-cli) --help' for usage info.
remote:
remote: Hash: 9809f658cd5ff48864d7
remote: Version: webpack 4.33.0
remote: Time: 555ms
remote: Built at: 06/12/2019 9:16:13 PM
remote:
remote: ERROR in Entry module not found: Error: Can't resolve 'babel-loader' in '/tmp/build_429e145805178d81754292048e646eab'
remote: Child html-webpack-plugin for "index.html":
remote: 1 asset
remote: Entrypoint undefined = index.html
remote: [0] ./node_modules/html-webpack-plugin/lib/loader.js!./public/index.html 1.9 KiB {0} [built]
remote: [2] (webpack)/buildin/global.js 472 bytes {0} [built]
remote: [3] (webpack)/buildin/module.js 497 bytes {0} [built]
remote: + 1 hidden module
remote: error Command failed with exit code 2.
remote: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
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 react-go-fullstack.
remote:
This is my package.json:
{
"name": "fullstack-course",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "rm -rf build/ && webpack-dev-server --env.mode development --hot",
"build": "rm -rf build/ && webpack --env.mode production"
},
"engines": {
"node": "10.x",
"yarn": "1.x"
},
"repository": {
"type": "git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/NaseebullahSafi/fullstack-course/issues"
},
"devDependencies": {
"#babel/cli": "^7.2.3",
"#babel/core": "^7.4.0",
"#babel/preset-env": "^7.4.2",
"#babel/preset-react": "^7.0.0",
"babel-loader": "^8.0.6",
"babel-plugin-styled-components": "^1.10.0",
"clean-webpack-plugin": "^2.0.1",
"css-loader": "^2.1.1",
"style-loader": "^0.23.1"
},
"dependencies": {
"copy-webpack-plugin": "^5.0.3",
"html-webpack-plugin": "^3.2.0",
"mini-css-extract-plugin": "^0.7.0",
"optimize-css-assets-webpack-plugin": "^5.0.1",
"prop-types": "^15.7.2",
"react": "^16.8.5",
"react-dom": "^16.8.6",
"react-hot-loader": "^4.8.0",
"react-redux": "^6.0.1",
"redux": "^4.0.1",
"redux-thunk": "^2.3.0",
"resources-manifest-webpack-plugin": "^3.0.0",
"styled-components": "^4.2.0",
"webpack": "^4.29.6",
"webpack-cli": "^3.3.4",
"webpack-dev-server": "^3.2.1",
"webpack-merge": "^4.2.1"
}
}
Can someone please explain what the issue is, and how can one resolve it.
Thanks

Push rejected, failed to compile Node.js app

I have mean stack node js app , I am trying to deploy it to heroku , unfortunatelly I am getting the following message.
remote: Installing any new modules (package.json)
remote: npm ERR! code EINVALIDTAGNAME
remote: npm ERR! Invalid tag name "^6.0.0.beta.1": Tags may not have any characters that encodeURIComponent encodes.
remote:
remote: npm ERR! A complete log of this run can be found in:
remote: npm ERR! /tmp/npmcache.3UQhB/_logs/2018-07-08T09_19_13_394Z-debug.log
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: Some possible problems:
remote:
remote: - node_modules checked into source control
remote: https://blog.heroku.com/node-habits-2016#9-only-git-the-important-bits
remote:
remote: - Node version not specified in package.json
remote: https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
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 proexebookingapp.
remote:
To https://git.heroku.com/proexebookingapp.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/proexebookingapp.git'
C:\Users\Bonge\Documents\Projects\bookinga
pp>
here is my package.json file
{
"name": "movies-database",
"version": "1.0.0",
"description": "a simple movie database Rest API",
"main": "index.js",
"scripts": {
"dev": "nodemon server.js"
},
"keywords": [],
"author": "Geofrey Julius Zellah",
"license": "ISC",
"dependencies": {
"body-parser": "^1.18.3",
"bootstrap": "^3.3.7",
"connect-flash": "^0.1.1",
"cors": "^2.8.4",
"express": "^4.16.3",
"jquery": "^3.3.1",
"mongodb": "^2.2.33",
"mongoose": "^5.1.5",
"node-rest-client": "^3.1.0",
"nodemon": "^1.17.5",
"request": "^2.87.0",
"winston": "^3.0.0",
"primeng": "^6.0.0.beta.1",
"primeicons": "^1.0.0-beta.6"
}
}
I tried different method from google but nothing helped, maybe some knows this problem in heroku deployment environment,
Please can some one help me on this?any help suggestion will be appreciated.
^6.0.0.beta.1 isn't a valid semantic version, this is what error message says.
As semantic versioning spec states,
A pre-release version MAY be denoted by appending a hyphen and a series of dot separated identifiers immediately following the patch version. Identifiers MUST comprise only ASCII alphanumerics and hyphen [0-9A-Za-z-]. Identifiers MUST NOT be empty. Numeric identifiers MUST NOT include leading zeroes. Pre-release versions have a lower precedence than the associated normal version. A pre-release version indicates that the version is unstable and might not satisfy the intended compatibility requirements as denoted by its associated normal version. Examples: 1.0.0-alpha, 1.0.0-alpha.1, 1.0.0-0.3.7, 1.0.0-x.7.z.92.
There's already a proper beta version next to primeng,
"primeicons": "^1.0.0-beta.6"
It should be:
"primeng": "^6.0.0-beta.1",

Error while deploying Angular App (NodeJS) to Heroku

I currently develop an angular5 app, and need to deploy it to Heroku.
This app is served using NodeJS.
After logging into Heroku, I create new app by:
heroku create angular-vbnmc
and it was successful, now i could open https://angular-vbnmc.herokuapp.com/ without problems, but still the content is blank, see picture below:
Then i deploy my app with following commands
git push heroku newFeatureBranch:master
Note: I didn't push my master branch but instead i push newFeatureBranch to remote heroku's master branch
and I got following error
Counting objects: 219, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (208/208), done.
Writing objects: 100% (219/219), 122.63 KiB | 3.50 MiB/s, done.
Total 219 (delta 111), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
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): 8.9.4
remote: engines.npm (package.json): 5.6.0
remote:
remote: Resolving node version 8.9.4...
remote: Downloading and installing node 8.9.4...
remote: npm 5.6.0 already installed with node
remote:
remote: -----> Restoring cache
remote: Skipping cache restore (not-found)
remote:
remote: -----> Building dependencies
remote: Prebuild detected (node_modules already exists)
remote: Rebuilding any native modules
remote: bootstrap#4.0.0 /tmp/build_61c2abaea4d9525f4aeb3f08e81769a2/node_modules/bootstrap
remote: Installing any new modules (package.json)
remote:
remote: > uws#0.14.5 install /tmp/build_61c2abaea4d9525f4aeb3f08e81769a2/node_modules/uws
remote: > node-gyp rebuild > build_log.txt 2>&1 || exit 0
remote:
remote:
remote: > node-sass#4.7.2 install /tmp/build_61c2abaea4d9525f4aeb3f08e81769a2/node_modules/node-sass
remote: > node scripts/install.js
remote:
remote: Downloading binary from https://github.com/sass/node-sass/releases/download/v4.7.2/linux-x64-57_binding.node
remote: Download complete
remote: Binary saved to /tmp/build_61c2abaea4d9525f4aeb3f08e81769a2/node_modules/node-sass/vendor/linux-x64-57/binding.node
remote: Caching binary to /tmp/npmcache.ShxWb/node-sass/4.7.2/linux-x64-57_binding.node
remote:
remote: > uglifyjs-webpack-plugin#0.4.6 postinstall /tmp/build_61c2abaea4d9525f4aeb3f08e81769a2/node_modules/webpack/node_modules/uglifyjs-webpack-plugin
remote: > node lib/post_install.js
remote:
remote:
remote: > node-sass#4.7.2 postinstall /tmp/build_61c2abaea4d9525f4aeb3f08e81769a2/node_modules/node-sass
remote: > node scripts/build.js
remote:
remote: Binary found at /tmp/build_61c2abaea4d9525f4aeb3f08e81769a2/node_modules/node-sass/vendor/linux-x64-57/binding.node
remote: Testing binary
remote: Binary is fine
remote:
remote: > angular-vbnmc#0.0.0 postinstall /tmp/build_61c2abaea4d9525f4aeb3f08e81769a2
remote: > ng build --prod
remote:
remote:
remote: An error occured during the build:
remote: Error: ENOENT: no such file or directory, open '/tmp/build_61c2abaea4d9525f4aeb3f08e81769a2/node_modules/bootstrap/dist/js/bootstrap.min.js'
remote: ENOENT: no such file or directory, open '/tmp/build_61c2abaea4d9525f4aeb3f08e81769a2/node_modules/bootstrap/dist/js/bootstrap.min.js'
remote: Error: ENOENT: no such file or directory, open '/tmp/build_61c2abaea4d9525f4aeb3f08e81769a2/node_modules/bootstrap/dist/js/bootstrap.min.js'
remote: npm ERR! code ELIFECYCLE
remote: npm ERR! errno 1
remote: npm ERR! angular-vbnmc#0.0.0 postinstall: `ng build --prod`
remote: npm ERR! Exit status 1
remote: npm ERR!
remote: npm ERR! Failed at the angular-vbnmc#0.0.0 postinstall script.
remote: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
remote:
remote: npm ERR! A complete log of this run can be found in:
remote: npm ERR! /tmp/npmcache.ShxWb/_logs/2018-03-06T04_54_08_334Z-debug.log
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: Some possible problems:
remote:
remote: - node_modules checked into source control
remote: https://blog.heroku.com/node-habits-2016#9-only-git-the-important-bits
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 angular-vbnmc.
remote:
To https://git.heroku.com/angular-vbnmc.git
! [remote rejected] 12-Deployment -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/angular-vbnmc.git'
For additional information, here is my package.json:
{
"name": "angular-vbnmc",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "node server.js",
"build": "ng build --prod",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"postinstall": "ng build --prod"
},
"private": true,
"dependencies": {
"#angular/animations": "^5.2.7",
"#angular/cli": "1.6.6",
"#angular/common": "^5.2.7",
"#angular/compiler": "^5.2.7",
"#angular/compiler-cli": "^5.2.7",
"#angular/core": "^5.2.7",
"#angular/forms": "^5.2.7",
"#angular/http": "^5.2.7",
"#angular/platform-browser": "^5.2.7",
"#angular/platform-browser-dynamic": "^5.2.7",
"#angular/router": "^5.2.7",
"bootstrap": "^4.0.0",
"core-js": "^2.4.1",
"express": "^4.16.2",
"jquery": "^3.3.1",
"popper.js": "^1.13.0",
"rxjs": "^5.5.6",
"typescript": "^2.6.2",
"zone.js": "^0.8.19"
},
"devDependencies": {
"#angular/language-service": "^5.2.7",
"#types/jasmine": "~2.8.3",
"#types/jasminewd2": "~2.0.2",
"#types/node": "^6.0.101",
"codelyzer": "^4.2.1",
"jasmine-core": "~2.8.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~2.0.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.1.2",
"ts-node": "~4.1.0",
"tslint": "5.8.0"
},
"engines": {
"node": "8.9.4",
"npm": "5.6.0"
}
}
Why is this happening? and how to fix this error?

Node.js app building error "UNMET DEPENDENCY phantomjs-prebuilt#^2.1.4" on Heroku platform

Project is cloned from existing repository and not yet modified:
https://github.com/ebdrup/html2pdf.it
I am looking for piece of information that would help me get through this simple looking yet frustrating warning/error. App cannot successfully run without phantomjs-prebuilt dependency and I am unskilled in Node.js and its project structures.
I have been researching and trying for almost 5 days now. I can manage to run the project locally through Node.js console easily.
The problem seems to be in telling the Heroku where to find the phantomjs-prebuilt file.
I have tried installing the dependency locally in the project directory with:
npm install
I have tried moving phantomjs binary manually into the bin/
I can run phantomjs on Heroku using:
heroku run phantomjs
CMD Output after building on Heroku:
remote: Building source:
remote:
remote: -----> Node.js app detected
remote:
remote: -----> Creating runtime environment
remote:
remote: NPM_CONFIG_LOGLEVEL=error
remote: NPM_CONFIG_PRODUCTION=true
remote: NODE_ENV=production
remote: NODE_MODULES_CACHE=true
remote:
remote: -----> Installing binaries
remote: engines.node (package.json): 0.10.x
remote: engines.npm (package.json): unspecified (use default)
remote:
remote: Resolving node version 0.10.x via semver.io...
remote: Downloading and installing node 0.10.48...
remote: Using default npm version: 2.15.1
remote:
remote: -----> Restoring cache
remote: Loading 2 from cacheDirectories (default):
remote: - node_modules
remote: - bower_components (not cached - skipping)
remote:
remote: -----> Building dependencies
remote: Installing node modules (package.json + shrinkwrap)
remote:
remote: -----> Caching build
remote: Clearing previous node cache
remote: Saving 2 cacheDirectories (default):
remote: - node_modules
remote: - bower_components (nothing to cache)
remote:
remote: -----> Build succeeded!
remote: ├── compression#1.4.0
remote: ├── express#4.11.2
remote: ├── morgan#1.5.1
remote: ├── node-uuid#1.4.2
remote: ├── UNMET DEPENDENCY phantomjs-prebuilt#^2.1.4
remote: ├── request#2.53.0
remote: └── slugify-url#1.2.0
remote:
remote: ! Unmet dependencies don't fail npm install but may cause runtime issues
remote: https://github.com/npm/npm/issues/7494
remote:
remote: -----> Discovering process types
remote: Procfile declares types -> (none)
remote: Default types for buildpack -> web
remote:
remote: -----> Compressing...
remote: Done: 32.9M
remote: -----> Launching...
remote: Released v5
remote: https://h2ptest.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.
To https://git.heroku.com/h2ptest.git
b278f4b..bce77f9 master -> master
package.json:
"engines": {
"node": "0.10.x"
},
"main": "./lib/app.js",
"dependencies": {
"compression": "^1.1.0",
"express": "",
"morgan": "^1.3.1",
"node-uuid": "",
"phantomjs-prebuilt": "^2.1.14",
"request": "",
"slugify-url": ""
},
"devDependencies": {
"mocha": "",
"chai": "",
"sinon": "",
"sinon-chai": "",
"underscore": "",
"mocha-jshint": "",
"open": ""
},
"scripts": {
"start": "node ./lib/app.js",
"test": "_mocha"
},
"directories": {
"test": "test"
},

Resources