Pushing to Heroku

Technical Support
  • Hey there,

    I'm trying to deploy an instance to Heroku. Download the latest git, ran the build script which takes the basic details on Mongo URL etc through the CLI... I can run with ./nodebb start - I've added the Procfile like in the documentation, added build, process.json etc to the git and committed... but when I push to Heroku I get this:

    NodeBB rob$ git push -u heroku master
    Enumerating objects: 204807, done.
    Counting objects: 100% (204807/204807), done.
    Delta compression using up to 8 threads
    Compressing objects: 100% (47568/47568), done.
    Writing objects: 100% (204807/204807), 62.28 MiB | 14.35 MiB/s, done.
    Total 204807 (delta 157705), reused 200124 (delta 156425), pack-reused 0
    remote: Compressing source files... done.
    remote: Building source:
    remote: -----> Node.js app detected
    remote: -----> Creating runtime environment
    remote:        NPM_CONFIG_LOGLEVEL=error
    remote:        NODE_ENV=production
    remote:        NODE_MODULES_CACHE=true
    remote:        NODE_VERBOSE=false
    remote: -----> Installing binaries
    remote:        engines.node (package.json):  >=10
    remote:        engines.npm (package.json):   unspecified (use default)
    remote:        Resolving node version >=10...
    remote:        Downloading and installing node 15.4.0...
    remote:        Using default npm version: 7.0.15
    remote: -----> Installing dependencies
    remote:        Installing node modules (package.json)
    remote:        npm ERR! code ERESOLVE
    remote:        npm ERR! ERESOLVE unable to resolve dependency tree
    remote:        npm ERR! 
    remote:        npm ERR! While resolving: [email protected]
    remote:        npm ERR! Found: [email protected]
    remote:        npm ERR! node_modules/nodebb-plugin-emoji
    remote:        npm ERR!   nodebb-plugin-emoji@"^3.3.0" from the root project
    remote:        npm ERR! 
    remote:        npm ERR! Could not resolve dependency:
    remote:        npm ERR! peer nodebb-plugin-emoji@"^2.0.0" from [email protected]
    remote:        npm ERR! node_modules/nodebb-plugin-emoji-android
    remote:        npm ERR!   nodebb-plugin-emoji-android@"2.0.0" from the root project
    remote:        npm ERR! 
    remote:        npm ERR! Fix the upstream dependency conflict, or retry
    remote:        npm ERR! this command with --force, or --legacy-peer-deps
    remote:        npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
    remote:        npm ERR! 
    remote:        npm ERR! See /tmp/npmcache.jq8Ib/eresolve-report.txt for a full report.
    remote:        npm ERR! A complete log of this run can be found in:
    remote:        npm ERR!     /tmp/npmcache.jq8Ib/_logs/2020-12-14T19_00_17_417Z-debug.log
    remote: -----> Build failed
    remote:        We're sorry this build is failing! You can troubleshoot common issues here:
    remote:        https://devcenter.heroku.com/articles/troubleshooting-node-deploys
    remote:        Some possible problems:
    remote:        - Dangerous semver range (>) in engines.node
    remote:          https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
    remote:        Love,
    remote:        Heroku
    remote:  !     Push rejected, failed to compile Node.js app.
    remote:  !     Push failed
    remote: Verifying deploy...
    remote: !       Push rejected to [my instance].
    To https://git.heroku.com/[my instance]-99878.git

    Any ideas?

    Many thanks!

  • @rob any way you can use a heroku instance with an older version of Node / npm?

  • @pitaj said in Pushing to Heroku:

    @rob any way you can use a heroku instance with an older version of Node / npm?

    Hey Pita

    Wanted to post earlier but had to wait for the post to be accepted, but you are correct. In case anyone else has the issue, this was it:

    In package.json the 'engine' line for node was =>10 so Heroku was choosing Node 15. Manually changed that value to the same as what works for me locally 12.14.1 - all works well. Now having fun setting up nodebb-plugin-session-sharing - cheers!!


Suggested Topics