Reputation: 141
I am trying to deploy the following web app with heroku:
https://github.com/darego1990/web1
although I get the following build log error and I am not sure why:
-----> Node.js app detected
-----> Creating runtime environment
NPM_CONFIG_LOGLEVEL=error
NODE_ENV=production
NODE_MODULES_CACHE=true
NODE_VERBOSE=false
-----> Installing binaries
engines.node (package.json): 0.12.x
engines.npm (package.json): 2.5.x
Resolving node version 0.12.x...
Downloading and installing node 0.12.18...
Bootstrapping npm 2.5.x (replacing 2.15.11)...
npm 2.5.x installed
-----> Building dependencies
Installing node modules (package.json + package-lock)
[email protected] node_modules/react
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected] ([email protected])
[email protected] node_modules/react-dom
├── [email protected]
├── [email protected] ([email protected])
├── [email protected]
└── [email protected]
[email protected] node_modules/next
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected]
├── [email protected]
.....
Running heroku-postbuild
> [email protected] heroku-postbuild
/tmp/build_f85d5b0987590f76e56a2945b6c4ccc1
> npm run build
> [email protected] build /tmp/build_f85d5b0987590f76e56a2945b6c4ccc1
> next build
/tmp/build_f85d5b0987590f76e56a2945b6c4ccc1/node_modules/next/dist/bin
/next:44
var inspectArg = process.argv.find(function (arg) {
^
TypeError: undefined is not a function
at Object.<anonymous>
(/tmp/build_f85d5b0987590f76e56a2945b6c4ccc1/node_modules/next/dist
/bin/next:44:31)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3
npm ERR! Linux 4.4.0-1031-aws
npm ERR! argv "node" "/tmp/build_f85d5b0987590f76e56a2945b6c4ccc1/.heroku/node/bin/npm" "run" "build"
npm ERR! node v0.12.18
npm ERR! npm v2.5.1
npm ERR! code ELIFECYCLE
npm ERR! [email protected] build: next build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script 'next build'.
npm ERR! This is most likely a problem with the my-app package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! next build
npm ERR! You can get their info via:
npm ERR! npm owner ls my-app
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /tmp/build_f85d5b0987590f76e56a2945b6c4ccc1/npm-debug.log
npm ERR! Linux 4.4.0-1031-aws
npm ERR! argv "node" "/tmp/build_f85d5b0987590f76e56a2945b6c4ccc1/.heroku/node/bin/npm" "run" "heroku-postbuild" "--if-present"
npm ERR! node v0.12.18
npm ERR! npm v2.5.1
npm ERR! code ELIFECYCLE
npm ERR! [email protected] heroku-postbuild: npm run build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] heroku-postbuild script 'npm run build'.
npm ERR! This is most likely a problem with the my-app package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! npm run build
npm ERR! You can get their info via:
npm ERR! npm owner ls my-app
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /tmp/build_f85d5b0987590f76e56a2945b6c4ccc1/npm-debug.log
-----> Build failed
We're sorry this build is failing! You can troubleshoot common issues here:
https://devcenter.heroku.com/articles/troubleshooting-node-deploys
If you're stuck, please submit a ticket so we can help:
https://help.heroku.com/
Love,
Heroku
! Push rejected, failed to compile Node.js app. ! Push failed
Upvotes: 1
Views: 1252
Reputation: 4521
Can you update your package.json
file with below:
"engines": {
"node": ">= 8.0.0"
}
It looks like your node engine is quite old and in next.js' github repo, looks like they are using >8.0.0.
Upvotes: 2