Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

npm doesn't work with node v0.8.5?

I'm deploying a Node app to Heroku and get the following error. If npm doesn't work with recent versions of Node, what are we supposed to use for a package manager? I really liked node_modules and package.json. It seemed very logical.

-----> Heroku receiving push
-----> Node.js app detected
-----> Resolving engine versions
       Using Node.js version: 0.8.5
       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.5
       Required: [email protected] || 0.5 || 0.6
like image 592
Geoff Avatar asked Aug 04 '12 03:08

Geoff


People also ask

Why my npm is not working?

If your npm is broken: On Mac or Linux, reinstall npm. Windows: If you're on Windows and you have a broken installation, the easiest thing to do is to reinstall node from the official installer (see this note about installing the latest stable version).

What version of npm is compatible with node?

npm code base currently uses ES6 but no higher. Latest Node 6 release covers 99% of ES6 spec, it's expected that NPM 6.2. 0 is fully workable with Node 6.14 or higher. Generally, it's certain that latest even major version (Node 10, as of now) doesn't have problems with latest NPM release.

Why is npm install failing?

This cause of this error is that one of the dependencies you define in your package. json file fails to be installed properly on your computer. This means that npm fails to install the node-sass module that's added as a dependency to the n-app project.


1 Answers

If you're specifying Node.js 0.8.x via "engines" in your package.json, you may also need to set a version for "npm":

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

From the Heroku Dev Center for Node.js:

If you do not specify a version, you will get the following defaults:

  • Node.js: 0.4.7
  • npm: 1.0.106

That page also includes links to supported version manifests for both.

like image 155
Jonathan Lonowski Avatar answered Oct 03 '22 20:10

Jonathan Lonowski