denisjacquemin
denisjacquemin

Reputation: 7414

deploy on heroku failed because npm version is not the latest

looks like heroku is using npm version 1.0.94

I have a dependency that require node 0.6.x, but npm 1.0.94 is 'based' on node 0.4.7

is there any workaround to solve this issue.

Installing dependencies with npm 1.0.94
       npm ERR! Unsupported
       npm ERR! Not compatible with your version of node/npm: [email protected]
       npm ERR! Required: {"node":"0.6.x"}
       npm ERR! Actual:   {"npm":"1.0.94","node":"0.4.7"}

Upvotes: 4

Views: 4138

Answers (4)

leebrandt
leebrandt

Reputation: 1788

You can specify the version of node and npm in the package.json file.

https://devcenter.heroku.com/articles/nodejs-versions

Worked for me.

Upvotes: 2

Vitaly Kushner
Vitaly Kushner

Reputation: 9455

You can build your own node version for heroku with buildpacks.

fork and modify node version in https://github.com/heroku/heroku-buildpack-nodejs

also see http://blog.superpat.com/2011/11/15/running-your-own-node-js-version-on-heroku/

Upvotes: 5

jdavid.net
jdavid.net

Reputation: 751

The example listed @ http://devcenter.heroku.com/articles/node-js

worked for me when I modified the package.json to the following:

{
  "name": "node-example",
  "version": "0.0.1",
  "dependencies": {
    "express": ">=2.2.0"
  }
}

Upvotes: 7

jAlpedrinha
jAlpedrinha

Reputation: 179

I believe Heroku Cedar doesn't use the latest version of node.js quite yet !

"Prerequisites

  • Basic Node.js knowledge, including an installed version of Node.js and NPM.

  • Your application must run on Node.js 0.4.7.

  • Your application must use NPM to manage dependencies."

(seen on Heroku Dev Center)

So the problem is not only the npm version, but the node.js version as well !

You should verify if you really need the latest version of node and if so, the only answer on using heroku is to wait for an update !

Best regards !

Upvotes: 0

Related Questions