heroku / heroku-buildpack-emberjs

**This buildpack is deprecated!** Please use the official Node.js buildpack combined with the static or nginx buildpack instead.
71 stars 28 forks source link

Ember-Cli app failing to build #36

Closed noskiboots closed 7 years ago

noskiboots commented 7 years ago

I am trying to deploy my app to Heroku using this buildpack. It has been working successfully for a while until about 2 weeks ago. I am getting the follow error output when attempting to deploy using "git push heroku master".

... remote: jquery-ui#1.11.4 bower_components/jquery-ui remote: └── jquery#3.2.1 remote: -----> Caching bower cache remote: -----> Installing ember-cli remote: /tmp/build_50041c603cdbc71593283bbb16c99813/.heroku/node/bin/ember -> /tmp/build_50041c603cdbc71593283bbb16c99813/.heroku/node/lib/node_modules/ember-cli/bin/ember remote: /tmp/build_50041c603cdbc71593283bbb16c99813/.heroku/node/bin/🐹 -> /tmp/build_50041c603cdbc71593283bbb16c99813/.heroku/node/lib/node_modules/ember-cli/bin/ember remote: remote: > spawn-sync@1.0.15 postinstall /tmp/build_50041c603cdbc71593283bbb16c99813/.heroku/node/lib/node_modules/ember-cli/node_modules/spawn-sync remote: > node postinstall remote: remote: added 578 packages in 19.901s remote: -----> Building ember assets remote: Invalid Version: https://registry.npmjs.org/ember-cli/-/ember-cli-2.13.1.tgz remote: TypeError: Invalid Version: https://registry.npmjs.org/ember-cli/-/ember-cli-2.13.1.tgz remote: at new SemVer (/tmp/build_50041c603cdbc71593283bbb16c99813/node_modules/semver/semver.js:293:11) remote: at compare (/tmp/build_50041c603cdbc71593283bbb16c99813/node_modules/semver/semver.js:566:10) remote: at Function.lt (/tmp/build_50041c603cdbc71593283bbb16c99813/node_modules/semver/semver.js:600:10) remote: at NPMDependencyVersionChecker.DependencyVersionChecker.(anonymous function) [as lt] (/tmp/build_50041c603cdbc71593283bbb16c99813/node_modules/ember-cli-version-checker/src/dependency-version-Error running: ember build --environment production 2>&1 remote: checker.js:53:26) remote: at Class.init (/tmp/build_50041c603cdbc71593283bbb16c99813/node_modules/ember-data/node_modules/ember-cli-babel/index.js:28:46) remote: at Class.superWrapper [as init] (/tmp/build_50041c603cdbc71593283bbb16c99813/node_modules/core-object/lib/assign-properties.js:34:20) remote: at Class.CoreObject (/tmp/build_50041c603cdbc71593283bbb16c99813/node_modules/core-object/core-object.js:9:15) remote: at Class (/tmp/build_50041c603cdbc71593283bbb16c99813/node_modules/core-object/core-object.js:21:5) remote: at Class (/tmp/build_50041c603cdbc71593283bbb16c99813/node_modules/core-object/core-object.js:21:5) remote: at graph.topsort.vertex (/tmp/build_50041c603cdbc71593283bbb16c99813/node_modules/ember-cli/lib/models/addons-factory.js:55:21) remote: -----> Failed trying to compile heroku/ember-cli-deploy remote: ! Push rejected, failed to compile emberjs app. remote: remote: ! Push failed remote: Verifying deploy... remote: remote: ! Push rejected to fitprep-app. remote: To https://git.heroku.com/fitprep-app.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/fitprep-app.git'

I have also switched my repo from github to bitbucket recently.

Matt-Jensen commented 7 years ago

TLDR; change your node engine in your package.json to the version of node that’s working for you locally.

Experiencing this as well with ember-cli@2.13.2 and the issue turned out the be how engines.node is getting defined by default in the newer ember-cli releases like this:

{
  "engines": {
    "node": "> 4"
  }
}

That was causing Heroku to download v8.0.0 of node which is likely unstable and ended up causing dependencies, required for the ember build process, to not get successfully installed.

I fixed this by setting my engine to an LTS release of node, one of which at this time is "6.10.3".

Dhaulagiri commented 7 years ago

I would concur based on similar reports that this is likely a Node 8 issue and would also recommend using the most recent LTS. If that doesn't fix this please re-open with any additional details that may be helpful.