Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node 0.8.x requires specifying npm as an engine in package.json #20

Closed
lookfirst opened this issue Oct 2, 2012 · 12 comments

Comments

@lookfirst
Copy link

commented Oct 2, 2012

I just moved to node 0.8.x by specifying in my package.json...

  "engines": {
    "node": "0.8.x"
  }

When I did that, I got this crazy useless error message:

-----> Heroku receiving push
-----> Node.js app detected
-----> Resolving engine versions
       Using Node.js version: 0.8.11
       Using npm version: 1.0.106
-----> Fetching Node.js binaries
-----> Vendoring node into slug
-----> Installing dependencies with npm
       Error: npm doesn't work with node v0.8.11
       Required: node@0.4 || 0.5 || 0.6
           at /tmp/node-npm-LvfM/bin/npm-cli.js:57:23
           at Object.<anonymous> (/tmp/node-npm-LvfM/bin/npm-cli.js:77:3)
           at Module._compile (module.js:449:26)
           at Object.Module._extensions..js (module.js:467:10)
           at Module.load (module.js:356:32)
           at Function.Module._load (module.js:312:12)
           at Module.require (module.js:362:17)
           at require (module.js:378:17)
           at Object.<anonymous> (/tmp/node-npm-LvfM/cli.js:2:1)
           at Module._compile (module.js:449:26)
       Error: npm doesn't work with node v0.8.11
       Required: node@0.4 || 0.5 || 0.6
           at /tmp/node-npm-LvfM/bin/npm-cli.js:57:23
           at Object.<anonymous> (/tmp/node-npm-LvfM/bin/npm-cli.js:77:3)
           at Module._compile (module.js:449:26)
           at Object.Module._extensions..js (module.js:467:10)
           at Module.load (module.js:356:32)
           at Function.Module._load (module.js:312:12)
           at Module.require (module.js:362:17)
           at require (module.js:378:17)
           at Object.<anonymous> (/tmp/node-npm-LvfM/cli.js:2:1)
           at Module._compile (module.js:449:26)
       Dependencies installed
-----> Building runtime environment
-----> Discovering process types
       Procfile declares types -> web
-----> Compiled slug size: 3.6MB
-----> Launching... done, v35

Specifying the npm version as * gives me this:

-----> Heroku receiving push
-----> Node.js app detected
-----> Resolving engine versions
       Using Node.js version: 0.8.11
 !     Requested engine npm version HEAD branches config description hooks info objects refs slugc_lock does not match available versions: 1.1.49 1.1.41 1.1.40 1.1.39 1.1.36 1.1.35 1.1.32 1.1.9 1.1.4 1.1.1 1.0.106 1.0.94 
 !     Heroku push rejected, failed to compile Node.js app

What finally worked:

  "engines": {
    "node": "0.8.x",
    "npm": "1.1.x"
  }

Ideally, the error messages would be a bit more helpful.

@lookfirst

This comment has been minimized.

Copy link
Author

commented Oct 3, 2012

To be clear, this is the crux of the issue:

https://github.com/heroku/heroku-buildpack-nodejs/blob/master/bin/compile#L111

There should be more logic added around those lines... if <0.8.x, use existing defaults. If >0.8.x use a different default npm (1.1.x).

@ddollar

This comment has been minimized.

Copy link
Contributor

commented Oct 3, 2012

I'll try to get a release out today addressing this.

@Lbatson

This comment has been minimized.

Copy link

commented Nov 7, 2012

I'm having an issue with npm installing my dependencies as well. I've set the required statement to specify the versions in my package.json like this

"engines": {
    "node": "0.8.x",
    "npm": "1.1.x"
},

However I'm getting the same type of error message

-----> Heroku receiving push
-----> Git submodules detected, installing
   Submodule 'lib/melonjs' (git://github.com/obiot/melonJS.git) registered for path 'lib/melonjs'
   Initialized empty Git repository in /tmp/build_i01xp3qtaq89/lib/melonjs/.git/
   Submodule path 'lib/melonjs': checked out 'b98aac1005c1329da0441959e1da77b5545d5219'
-----> Node.js app detected
-----> Resolving engine versions
   Using Node.js version: 0.8.14
   Using npm version: 1.0.106
-----> Fetching Node.js binaries
-----> Vendoring node into slug
-----> Installing dependencies with npm
   Error: npm doesn't work with node v0.8.14
   Required: node@0.4 || 0.5 || 0.6
       at /tmp/node-npm-VTSu/bin/npm-cli.js:57:23
       at Object.<anonymous> (/tmp/node-npm-VTSu/bin/npm-cli.js:77:3)
       at Module._compile (module.js:449:26)
       at Object.Module._extensions..js (module.js:467:10)
       at Module.load (module.js:356:32)
       at Function.Module._load (module.js:312:12)
       at Module.require (module.js:362:17)
       at require (module.js:378:17)
       at Object.<anonymous> (/tmp/node-npm-VTSu/cli.js:2:1)
       at Module._compile (module.js:449:26)
   Error: npm doesn't work with node v0.8.14
   Required: node@0.4 || 0.5 || 0.6
       at /tmp/node-npm-VTSu/bin/npm-cli.js:57:23
       at Object.<anonymous> (/tmp/node-npm-VTSu/bin/npm-cli.js:77:3)
       at Module._compile (module.js:449:26)
       at Object.Module._extensions..js (module.js:467:10)
       at Module.load (module.js:356:32)
       at Function.Module._load (module.js:312:12)
       at Module.require (module.js:362:17)
       at require (module.js:378:17)
       at Object.<anonymous> (/tmp/node-npm-VTSu/cli.js:2:1)
       at Module._compile (module.js:449:26)
   Dependencies installed
-----> Building runtime environment
-----> Discovering process types
   Procfile declares types -> (none)
-----> Compiled slug size: 66.7MB
-----> Launching... done, v4
@lookfirst

This comment has been minimized.

Copy link
Author

commented Nov 7, 2012

@intothev01d that's odd... i just pushed an app a few minutes ago with the same engines json and it worked fine. Can you include the full output of the deployment? It should show which version of npm it is trying to use.

@Lbatson

This comment has been minimized.

Copy link

commented Nov 7, 2012

Sure, I've updated my comment above with the full output.

@Lbatson

This comment has been minimized.

Copy link

commented Nov 7, 2012

Ok found my issue. Once I added the npm like you stated I hadn't commited it so it was just still using the default. I've commited the change it now works. Would still be cool to have it determine npm based on the node version though. Thanks for the help!

@lookfirst

This comment has been minimized.

Copy link
Author

commented Nov 7, 2012

Sweet. Glad you figured it out. And yes, I agree that it would be nice if @ddollar would fix this.

@ricardobeat

This comment has been minimized.

Copy link

commented Jan 4, 2013

Still the same. @ddollar ?

@cee-dub

This comment has been minimized.

Copy link

commented Jan 18, 2013

Just hit this.

@sindresorhus

This comment has been minimized.

Copy link

commented Jan 20, 2013

Was just hit by this too...

@bjornstar

This comment has been minimized.

Copy link

commented Feb 10, 2013

Still busted... Anyone awake over there?

@zeke

This comment has been minimized.

Copy link
Contributor

commented Apr 9, 2013

Fixed by 5271c2a

@zeke zeke closed this Apr 9, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
8 participants
You can’t perform that action at this time.