Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Deploying meanJS to Heroku fails #1928

Open
dylib opened this issue Nov 28, 2017 · 6 comments
Open

Deploying meanJS to Heroku fails #1928

dylib opened this issue Nov 28, 2017 · 6 comments

Comments

@dylib
Copy link

dylib commented Nov 28, 2017

When attempting the Heroku deploy method the build fails:

       NPM_CONFIG_LOGLEVEL=error
       NPM_CONFIG_PRODUCTION=true
       NODE_VERBOSE=false
       NODE_ENV=production
       NODE_MODULES_CACHE=true
-----> Installing binaries
       engines.node (package.json):  >=6.10.0
       engines.npm (package.json):   >=3.10.8
       Resolving node version >=6.10.0...
       Downloading and installing node 9.2.0...
       Bootstrapping npm >=3.10.8 (replacing 5.5.1)...
       npm 5.5.1 installed
-----> Restoring cache
       Skipping cache restore (not-found)
-----> Building dependencies
       Installing node modules (package.json + package-lock)
       WARNING: You are likely using a version of node-tar or npm that is incompatible with this version of Node.js.
       Please use either the version of npm that is bundled with Node.js, or a version of npm (> 5.5.1 or < 5.4.0) or node-tar (> 4.0.1) that is compatible with Node.js 9 and above.
       /tmp/build_bb353812ff65ddafc05eecefe9616a89/meanjs-mean-ab89162/.heroku/node/bin/node[281]: ../src/node_zlib.cc:437:static void node::{anonymous}::ZCtx::Init(const v8::FunctionCallbackInfo<v8::Value>&): Assertion `args.Length() == 7 && "init(windowBits, level, memLevel, strategy, writeResult, writeCallback," " dictionary)"' failed.
       1: node::Abort() [npm]
       2: node::Assert(char const* const (*) [4]) [npm]
       3: 0x1255aff [npm]
       4: v8::internal::FunctionCallbackArguments::Call(void (*)(v8::FunctionCallbackInfo<v8::Value> const&)) [npm]
       5: 0xb77f9c [npm]
       6: v8::internal::Builtin_HandleApiCall(int, v8::internal::Object**, v8::internal::Isolate*) [npm]
       7: 0x2528558042fd
/app/tmp/buildpacks/19862b8792e84bd8421ded4660b92dfd1c41d92e19ac0b38c90301adc8ae3e0bd512fa01998af18fc2f0d31a157e9c82e8fdceba1a05e5d29adb8dc2bfaf08e1/lib/dependencies.sh: line 111:   281 Aborted
npm install --unsafe-perm --userconfig $build_dir/.npmrc 2>&1
-----> Build failed
       We're sorry this build is failing! You can troubleshoot common issues here:
       https://devcenter.heroku.com/articles/troubleshooting-node-deploys
       Some possible problems:
       - Dangerous semver range (>) in engines.node
       https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
      
       Love,
       Heroku

 !     Push rejected, failed to compile Node.js app.
 !     Push failed

Any suggestions? Thank you.

* Note this also happens with meanTorrent, as noted with issue #36 here.

@dylib dylib changed the title Deploying meanJS To Heroku fails Deploying meanJS to Heroku fails Nov 28, 2017
@Ghalleb
Copy link
Contributor

Ghalleb commented Nov 28, 2017

Try replacing node engine version ">=6.10.0" with "9.2.0".
Heroku doesn't like the use of ">" for engine version anymore.
You can change npm version to the latest as well.

@dylib
Copy link
Author

dylib commented Nov 29, 2017

@Ghalleb: How would I change it, or where exactly? I'm just clicking the button in the main ReadME:

button

Thanks...

@Ghalleb
Copy link
Contributor

Ghalleb commented Nov 29, 2017 via email

@dylib
Copy link
Author

dylib commented Nov 30, 2017

@Ghalleb: Ah that makes sense. Thanks for the tips on how to go about updating it... I'm not in a huge hurry though, so I might just wait for you to publish the fix. :)

@Ghalleb
Copy link
Contributor

Ghalleb commented Dec 2, 2017

@dylib
You can use this version:
https://github.com/Ghalleb/mean
I forked the mean.js repository and simply made the changes I told you
Sorry for the delay, my laptop just came back from the repair shop

@simison @mleanos @lirantal
Wouldn't it be a good idea to have "absolute" versions for engines?
As Heroku says: - Dangerous semver range (>) in engines.node

@dylib
Copy link
Author

dylib commented Dec 10, 2017

@Ghalleb: The new version works great! There were just a couple warnings in the build log:

-----> Build succeeded!

 !     Unmet dependencies don't fail npm install but may cause runtime issues
       https://github.com/npm/npm/issues/7494

 !     This version of npm (3.10.8) does not support package-lock.json. Please
       update your npm version in package.json.
       https://devcenter.heroku.com/articles/nodejs-support#specifying-an-npm-version

Deploying to Heroku went smooth, so thanks very much for updating it!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants