Reputation: 10945
This morning I got the failure messages below when I tried to push to my Heroku repo.
I am using the same version of Node.js that I did with my last deploy and I cannot find any docs that explain what the failure means.
It seems to be some kind of compile issue with node-gyp but I have no idea how to resolve it.
Here is the console output from the attempted deploy:
Enumerating objects: 43, done.
Counting objects: 100% (43/43), done.
Delta compression using up to 12 threads
Compressing objects: 100% (24/24), done.
Writing objects: 100% (26/26), 16.71 KiB | 2.09 MiB/s, done.
Total 26 (delta 18), reused 0 (delta 0), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
remote: -----> Using buildpack: heroku/nodejs
remote: -----> Node.js app detected
remote:
remote: -----> Creating runtime environment
remote:
remote: NPM_CONFIG_PRODUCTION=false
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): 14.16.0
remote: engines.npm (package.json): unspecified (use default)
remote:
remote: Resolving node version 14.16.0...
remote: Downloading and installing node 14.16.0...
remote: Using default npm version: 6.14.11
remote:
remote: -----> Restoring cache
remote: - node_modules
remote:
remote: -----> Installing dependencies
remote: Installing node modules
remote:
remote: > [email protected] install /tmp/build_d06f6627/node_modules/sq-native
remote: > node ./install.js
remote:
remote:
remote: > [email protected] install /tmp/build_d06f6627/node_modules/event-loop-stats
remote: > node-gyp rebuild
remote:
remote: make: Entering directory '/tmp/build_d06f6627/node_modules/event-loop-stats/build'
remote: CXX(target) Release/obj.target/eventLoopStats/src/eventLoopStats.o
remote: In file included from ../../nan/nan.h:56,
remote: from ../src/eventLoopStats.cc:1:
remote: /app/.cache/node-gyp/14.16.0/include/node/node.h:758:43: warning: cast between incompatible function types from ‘void (*)(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)’ {aka ‘void (*)(v8::Local<v8::Object>)’} to ‘node::addon_register_func’ {aka ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)’} [-Wcast-function-type]
remote: 758 | (node::addon_register_func) (regfunc), \
remote: | ^
remote: /app/.cache/node-gyp/14.16.0/include/node/node.h:792:3: note: in expansion of macro ‘NODE_MODULE_X’
remote: 792 | NODE_MODULE_X(modname, regfunc, NULL, 0) // NOLINT (readability/null_usage)
remote: | ^~~~~~~~~~~~~
remote: ../src/eventLoopStats.cc:95:1: note: in expansion of macro ‘NODE_MODULE’
remote: 95 | NODE_MODULE(eventLoopStats, init)
remote: | ^~~~~~~~~~~
remote: SOLINK_MODULE(target) Release/obj.target/eventLoopStats.node
remote: COPY Release/eventLoopStats.node
remote: make: Leaving directory '/tmp/build_d06f6627/node_modules/event-loop-stats/build'
remote:
remote: > [email protected] postinstall /tmp/build_d06f6627/node_modules/ejs-mate/node_modules/ejs
remote: > node ./postinstall.js
remote:
remote:
remote: > [email protected] install /tmp/build_d06f6627/node_modules/bcrypt
remote: > node-pre-gyp install --fallback-to-build
remote:
remote: [bcrypt] Success: "/tmp/build_d06f6627/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node" is installed via remot
remote:
remote: > @sp/[email protected] postinstall /tmp/build_d06f6627/node_modules/@sp/omega
remote: > npm run build-files
remote:
remote:
remote: > @sp/[email protected] build-files /tmp/build_d06f6627/node_modules/@sp/omega
remote: > omega build
remote:
remote: sh: 1: omega: Permission denied
remote: npm ERR! code ELIFECYCLE
remote: npm ERR! errno 126
remote: npm ERR! @sp/[email protected] build-files: `omega build`
remote: npm ERR! Exit status 126
remote: npm ERR!
remote: npm ERR! Failed at the @sp/[email protected] build-files 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.4dZx9/_logs/2021-04-06T16_09_47_101Z-debug.log
remote: npm ERR! code ELIFECYCLE
remote: npm ERR! errno 126
remote: npm ERR! @sp/[email protected] postinstall: `npm run build-files`
remote: npm ERR! Exit status 126
remote: npm ERR!
remote: npm ERR! Failed at the @sp/[email protected] 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.4dZx9/_logs/2021-04-06T16_09_47_164Z-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: 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 beta-???????????-net.
remote:
To https://git.heroku.com/beta-???????????-net.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/beta-???????????-net.git'
Upvotes: 2
Views: 3173
Reputation: 108676
This error happens when Heroku tries to npm install event-loop-stats
. We know that because of this line in the error message.
make: Entering directory '/tmp/build_d06f6627/node_modules/event-loop-stats/build'
That module uses gyp
because installing it requires compiling some C++ - language stuff to make it work. On its npm page at the bottom there's a notice about compatibility. Following the link on that notice shows that it works on node v6, v10, and v12. But you tell Heroku to use v14.
Tell heroku to use v12 by putting this in your package.json
"engines": {
"node": "12.x"
Upvotes: 2