Bug 223615 - www/npm 5.4.2 does not support node v9.1.0
Summary: www/npm 5.4.2 does not support node v9.1.0
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Po-Chuan Hsieh
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-11 22:17 UTC by pete
Modified: 2017-12-13 14:52 UTC (History)
7 users (show)

See Also:


Attachments
Add NODE9 option to www/npm (916 bytes, patch)
2017-11-15 18:54 UTC, Peter Sagerson
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description pete 2017-11-11 22:17:48 UTC
when installing the npm package it pulls in node-9.1.0 as a dependency.  when executing npm to install packages it fails like so:

$ npm install triton
npm WARN npm npm does not support Node.js v9.1.0
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8.
npm WARN npm You can find the latest version at https://nodejs.org/
WARNING: You are likely using a version of node-tar or npm that is incompatible with this version of Node.js.k for /usr/home/pwright/node_modules/.staging
Please use either the version of npm that is bundled with Node.js, or a version of npm (> 5.5.1 or < 5.4.0) or node-tar (> 4.0.1) that is compatible with Node.js 9 and above.
/usr/local/bin/node[75829]: ../src/node_zlib.cc:437:static void node::(anonymous namespace)::ZCtx::Init(const FunctionCallbackInfo<v8::Value> &): Assertion `args.Length() == 7 && "init(windowBits, level, memLevel, strategy, writeResult, writeCallback," " dictionary)"' failed.
 1: node::Abort(void) [/usr/local/bin/node]
 2: node::Assert(char const* const[4]*) [/usr/local/bin/node]
 3: _ZNSt3__16vectorIPN4node14SigintWatchdogENS_9allocatorIS3_EEE21__push_back_slow_pathIRKS3_EEvOT_ [/usr/local/bin/node]
 4: v8::internal::FunctionCallbackArguments::Call(void(*)(v8::FunctionCallbackInfo<v8::Value> const&)) [/usr/local/bin/node]
 5: v8::internal::Isolate*<v8::internal::Object> v8::internal::Builtins::InvokeApiFunction(v8::internal::Isolate*, bool, v8::internal::Handle<v8::internal::HeapObject>(int, v8::internal::Object*, v8::internal::HeapObject) [/usr/local/bin/node]
Abort trap (core dumped)


removing npm-5.4.2 and installing npm4 (which also uses node-9.1.0) works as expected.
Comment 1 CTS - FreeBSD Team 2017-11-14 17:48:47 UTC
This is a duplicate of bug #223534
Comment 2 CTS - FreeBSD Team 2017-11-14 17:49:41 UTC
*aahhhrg* no, it's not a duplicate! Sorry!
Comment 3 Peter Sagerson 2017-11-15 18:54:18 UTC
Created attachment 188028 [details]
Add NODE9 option to www/npm

If nothing else, it seems like www/npm needs a new NODE9 option. NODE8 remains the default and points to www/node8 instead of www/node.

This produced a working npm package for me.
Comment 4 CTS - FreeBSD Team 2017-11-15 18:58:28 UTC
Peter, you made the same mistake as i did. This is NOT exactly the core of this problem. Here it is about the compatibility of npm-5 with node-9 in general. Your patch addresses bug #223534
Comment 5 Darcy Buskermolen 2017-11-17 13:42:44 UTC
Correct, so if the other patch supports adding NODE9, then a update to npm-5.5.1+ should address the incompatibility in the existing npm(5) port
Comment 6 pete 2017-11-17 17:20:24 UTC
(In reply to darcy from comment #5)
Sounds good to me, although I guess I'm a little confused.  

Issuing a "pkg install npm" pulls in node-9.1.0 as a dependency, as does "pkg install npm4".  is the issue that npm is not compatible with node-9 or is something else happening that i'm not getting.  thanks!
Comment 7 Darcy Buskermolen 2017-11-18 11:43:38 UTC
The current Version of npm5 (5.4.2) in www/npm is not compatible with node9,   Either it needs to be less than 5.4.0 or greater than 5.5.1 as per npm's self-reported error.


npm WARN npm npm does not support Node.js v9.1.0
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8.
npm WARN npm You can find the latest version at https://nodejs.org/
WARNING: You are likely using a version of node-tar or npm that is incompatible with this version of Node.js.k for /usr/home/pwright/node_modules/.staging
Please use either the version of npm that is bundled with Node.js, or a version of npm (> 5.5.1 or < 5.4.0) or node-tar (> 4.0.1) that is compatible with Node.js 9 and above.
Comment 8 Po-Chuan Hsieh freebsd_committer freebsd_triage 2017-11-18 14:39:14 UTC
I would like to let npm to track upstream release (5.4.2 now).

There are multiple problems here:
- npm does not officially support node 9.x now
- there's no npm > 5.5.1
- npm 5.5.1 is a pre-release
Comment 9 Darcy Buskermolen 2017-11-18 15:00:07 UTC
According to npmjs.org 5.5.1 is the latest release (they do not say anything about it being a pre-release)

Also I think the note that npm has saying that Node 9.1 requires npm > 5.5.1  really should be >= 5.5.1.

I'm able to install an older supported version of npm then npm -g upgrade npm   it will upgrade me to 5.5.1 which works fine. But the moment I do that I end up not being able to manage the system fully via ports any longer.
Comment 10 Po-Chuan Hsieh freebsd_committer freebsd_triage 2017-11-18 15:06:46 UTC
https://github.com/npm/npm/releases
Comment 11 Smartypants 2017-12-03 18:46:50 UTC
(In reply to darcy from comment #9)

You are right. Installing an older version and upgrading it seem to work. If someone is looking for a temporary workaround:

pkg install -y node npm && pkg install -y npm4-4.6.1 && npm install npm@latest -g
Comment 12 Smartypants 2017-12-03 18:58:12 UTC
Correction to my last comment, it doesn't even work with the latest stable npm (5.5.1) but the pre-release (5.6.0) seem to be fixed for node 9.2.

To upgrade to the pre-release use this instead:

pkg install -y node npm && pkg install -y npm4-4.6.1 && npm install npm@next -g
Comment 13 Jonathan Chen 2017-12-04 02:01:59 UTC
The latest release 5.6.0 addresses the node-9 breakage.

https://github.com/npm/npm/releases/tag/v5.6.0

I would attempted to add a patch for the upgrade, but the MASTER_SITES on this www/npm uses a local copy instead of github tag.
Comment 14 Po-Chuan Hsieh freebsd_committer freebsd_triage 2017-12-09 11:26:57 UTC
(In reply to darcy from comment #9)

Though node 9.1.0 ships npm 5.5.1, I'm sure that you cannot build npm 5.5.1 from source with node 9. At least I failed to build npm 5.5.1 tarball (for www/npm) with node 9.1.0 and 9.2.0.
Comment 15 Po-Chuan Hsieh freebsd_committer freebsd_triage 2017-12-09 12:20:48 UTC
Though npm 5.6.0 is a pre-release, I'll commit it after poudriere build completes (maybe tomorrow).
Comment 16 Po-Chuan Hsieh freebsd_committer freebsd_triage 2017-12-13 14:52:38 UTC
npm 5.6.0 landed ports tree in r455950. Thanks!