[Pkg-javascript-devel] Bug#1070103: libnode-dev: Version bump of NODE_MODULE_VERSION makes node-gyp build broken modules

Matijs van Zuijlen matijs at matijs.net
Tue Apr 30 08:33:23 BST 2024


On 30/04/2024 08:53, Jérémy Lal wrote:
> 
> 
> Le mar. 30 avr. 2024 à 08:21, Matijs van Zuijlen <matijs at matijs.net 
> <mailto:matijs at matijs.net>> a écrit :
> 
>     Package: libnode-dev
>     Version: 18.20.1+dfsg-4+b2
>     Severity: normal
> 
>     Dear maintainer,
> 
>     I tried building and installing the renovate tool from npm, using
>     npm -g install renovate.
> 
>     This went well but when I run it I get the message
> 
>        The module
>     '/usr/local/lib/node_modules/renovate/node_modules/re2/build/Release/re2.node'
>        was compiled against a different Node.js version using
>        NODE_MODULE_VERSION 108. This version of Node.js requires
>        NODE_MODULE_VERSION 109. Please try re-compiling or re-installing
>        the module (for instance, using `npm rebuild` or `npm install
> 
>     After some investigation I found out that re2.node is compiled using a
>     tool called node-gyp, and that tool fetches the node_version.h from
>     https://nodejs.org/download/release/v18.20.1/node-v18.20.1-headers.tar.gz <https://nodejs.org/download/release/v18.20.1/node-v18.20.1-headers.tar.gz>
>     instead of using the locally installed one. This
>     upstream version has 108 as the NODE_MODULE_VERSION, of course.
> 
> 
> You're supposed to use system-installed modules, especially for node-gyp.
> If you're using /usr/bin/node-gyp and it is doing that, then it's a bug 
> in node-gyp.
> Also note that node-re2 is available in debian.

I have debian versions of both node-re2 and node-gyp installed, but npm 
-g install renovate doesn't pick those up. The npm I'm using is the npm 
from the debian npm package.

> To solve both, you should do `pkgjs-install` next to package.json, so 
> that your system-installed
> modules are symlinked to the local node_modules directory.
> Then "npm install" shouldn't remove the symlinks and install just the 
> missing ones.

There is no package.json, because I am using npm -g install renovate, 
not installing from a checked-out repository. Is npm -g install not 
supposed to work?

I will now try installing from the repository and let you know if that 
works.

> In any case, node 20 or 22 is going to debian unstable soon enough, and 
> we'll have "standard" modules versions again.

Looking forward to it!

> Jérémy



More information about the Pkg-javascript-devel mailing list