8000 Incompatible with versions of NodeJS under 6.0.0 · Issue #20425 · npm/npm · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Aug 11, 2022. It is now read-only.

Incompatible with versions of NodeJS under 6.0.0 #20425

Closed
1 task done
RazzM13 opened this issue Apr 24, 2018 · 12 comments
Closed
1 task done

Incompatible with versions of NodeJS under 6.0.0 #20425

RazzM13 opened this issue Apr 24, 2018 · 12 comments

Comments

@RazzM13
Copy link
RazzM13 commented Apr 24, 2018

I'm opening this issue because:

  • npm is crashing.

What's going wrong?

Apparently, the 6.0.0 version of npm is incompatible with NodeJS under 6.0.0 and crashes with the following stacktrace:

/home/xxx/.envirius/envs/node-5.9.1/lib/node_modules/npm/bin/npm-cli.js:79
      let notifier = require('update-notifier')({pkg})
      ^^^

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:387:25)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Function.Module.runMain (module.js:447:10)
    at startup (node.js:142:18)
    at node.js:939:3

How can the CLI team reproduce the problem?

  1. Install any version of NodeJS under 6.0.0 and npm at 6.0.0;
  2. Attempt to execute npm -v.

Context:

OS: Linux / Archlinux
Env: envirius
NodeJS versions that are failling: 4.1.0, 4.1.1, 4.1.2, 4.2.0, 4.2.1, 4.2.2, 4.2.3, 4.2.4, 4.2.5, 4.2.6, 4.3.0, 4.3.1, 4.3.2, 4.4.0, 4.4.1, 4.4.2, 4.4.3, 4.4.4, 4.4.5, 4.4.6, 4.4.7, 4.5.0, 4.6.0, 4.6.1, 4.6.2, 4.7.0, 4.7.1, 4.7.2, 4.7.3, 4.8.0, 4.8.1, 4.8.2, 4.8.3, 4.8.4, 4.8.5, 4.8.6, 4.8.7, 4.9.0, 4.9.1, 5.0.0, 5.1.0, 5.1.1, 5.2.0, 5.3.0, 5.4.0, 5.4.1, 5.5.0, 5.6.0, 5.7.0, 5.7.1, 5.8.0, 5.9.0, 5.9.1, 5.10.0, 5.10.1, 5.11.0, 5.11.1, 5.12.0.

@kenany
Copy link
Contributor
kenany commented Apr 24, 2018

If intentional, we may need to update the README to reflect that npm requires at least Node.js v6 now. Node.js v4 LTS ended this month (April). Also note that Node.js v5 was the unstable release line which became v6 several months ago, so it should probably not be used anymore.

@zkat
Copy link
Contributor
zkat commented Apr 24, 2018

We dropped support for node@4 as part of npm@6, as one of its breaking changes (see the release notes). This is as @kenany says -- because node@4 has dropped off its maintenance window and is no longer supported by Node Core. We routinely drop support for node versions that are no longer supported by Node Core with the next semver-major npm release after the most recent Node EOL.

@zkat zkat closed this as completed Apr 24, 2018
@nfischer
Copy link
nfischer commented May 8, 2018

@zkat could you update the README? Right now, it explicitly states support for node v4.

@zkat
Copy link
Contributor
zkat commented May 8, 2018

@nfischer: you wanna PR that? :)

@fabian3087
Copy link

RazzM13,

I'm working with a Multitech conduit whit module LoRa, I haven't the same problem than you, but I do reload the same firware version and that works

image

image

Now I Update the Node-red version

image

@RazzM13
Copy link
Author
RazzM13 commented May 25, 2018

Hi @fabian3087, I'm not really sure I understand how the two scenarios are related ... but if I can help you with anything just let me know :)

@QuietNoise
Copy link
QuietNoise commented Jun 10, 2018

Running:
npm install -g npm
(as suggested by npm itself)
on node < 6.0.0 breaks the node installation.

If npm 6 is not compatible with node 5 then generic npm upgrade command shouldn't install it or should install latest compatible version rather than breaking the installation with something that cannot be used..
Alternatively some sort of confirmation dialogue would be helpful to let layman know they are entering muddy waters.

@geethika-zen
Copy link

What's the solution for this? I'm not able to update node nor revert to older version of npm!

@legodude17
Copy link
Contributor

Reinstall node from the website (I recommend the latest version).

@QuietNoise
Copy link

Yup. You have to uninstall the node and install it again. And probably later you will have to catch and install all global packages that were used by your projects. That's how bad this small, ignored bug is.

@legodude17
Copy link
Contributor

@QuietNoise How exactly is this a bug?

@QuietNoise
Copy link
QuietNoise commented Jun 15, 2018

Read my previous comment #20425 (comment) and ask yourself how is this not a bug?

A regular command destroys the entire installation and leaves a user without a non destructive way to reverse it.

The bug is in not having a simple version or flag check that would prevent installing a major software component that is incompatible with core platform that is installing it.

To reiterate:
npm install -g npm
destroys every perfectly running Node 5.x.x installation out there because from there you are unable to use npm without completely reinstalling Node.

Let me put you into perspective of every Node 5 user:

  1. You run your daily Node tasks, install some global packages, run some commands.
  2. Every npm command you run displays a very prominent message stating that you are using version x.x.x and there is a new version 6.0.1 available and that you should update it using command npm install -g npm.
  3. Nowhere it says that the moment you run this command you are effectively going to make npm unusable altogether.
  4. As every non-seer regular user - who trusts the software vendor and who wants to have a peace of mind - you run this command as suggested.
  5. And boom. You've just destroyed the very component you were updating.

The result of this command is completely against any expectation of every Node 5 user who will run it.

As a software developer you can’t expect that end user will understand your software internals and predict unexpected destructive behaviour.
It’s like running Windows Update (or any other software update) just to make Windows Update (or any other software update component) unusable.

Hence, I reckon it is a bug.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants
0