Install fails: TypeError: Class constructor Range cannot be invoked without 'new'
Powersource opened this issue · comments
On commit 694893416576229337993a22ac0c6c486dc13b87
and with a removed node_modules, i get this on npm i:
make[2]: Leaving directory '/home/me/prj/web/cabal-cli/node_modules/sodium-native/libsodium/test'
make[1]: Leaving directory '/home/me/prj/web/cabal-cli/node_modules/sodium-native/libsodium/test'
make[1]: Entering directory '/home/me/prj/web/cabal-cli/node_modules/sodium-native/libsodium'
make[2]: Entering directory '/home/me/prj/web/cabal-cli/node_modules/sodium-native/libsodium'
make[2]: Nothing to be done for 'install-exec-am'.
/usr/bin/mkdir -p '/home/me/prj/web/cabal-cli/node_modules/sodium-native/tmp/lib/pkgconfig'
/usr/bin/install -c -m 644 libsodium.pc '/home/me/prj/web/cabal-cli/node_modules/sodium-native/tmp/lib/pkgconfig'
make[2]: Leaving directory '/home/me/prj/web/cabal-cli/node_modules/sodium-native/libsodium'
make[1]: Leaving directory '/home/me/prj/web/cabal-cli/node_modules/sodium-native/libsodium'
gyp ERR! UNCAUGHT EXCEPTION
gyp ERR! stack TypeError: Class constructor Range cannot be invoked without 'new'
gyp ERR! stack at PythonFinder.<anonymous> (/usr/lib/node_modules/node-gyp/lib/find-python.js:229:28)
gyp ERR! stack at PythonFinder.execFileCallback (/usr/lib/node_modules/node-gyp/lib/find-python.js:274:7)
gyp ERR! stack at ChildProcess.exithandler (child_process.js:294:7)
gyp ERR! stack at ChildProcess.emit (events.js:321:20)
gyp ERR! stack at maybeClose (internal/child_process.js:1028:16)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
gyp ERR! System Linux 5.4.8-arch1-1
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/me/prj/web/cabal-cli/node_modules/sodium-native
gyp ERR! node -v v13.6.0
gyp ERR! node-gyp -v v6.0.1
gyp ERR! This is a bug in `node-gyp`.
gyp ERR! Try to update node-gyp and file an Issue if it does not help:
gyp ERR! <https://github.com/nodejs/node-gyp/issues>
npm ERR! code ELIFECYCLE
npm ERR! errno 7
npm ERR! sodium-native@2.4.6 install: `node-gyp-build "node preinstall.js" "node postinstall.js"`
npm ERR! Exit status 7
npm ERR!
npm ERR! Failed at the sodium-native@2.4.6 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
% node --version
v13.6.0
% npm --version
6.13.4
I have a feeling it might be arch's really recent node version, which was released yesterday! @christianbundy do you get the same?
Thanks for the ping. It's working fine for me, but I'm on Node 12. Maybe it'd be worth checking to see if you can npm install
sodium-native? I recently opened an issue on that repo about getting Node.js 13 prebuilds: sodium-friends/sodium-native#116
Yeah something like that issue is up, in cabal-desktop I'm getting
Uncaught Error: The module '/home/me/prj/web/cabal-desktop/node_modules/sodium-native/build/Release/sodium.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 79. This version of Node.js requires
NODE_MODULE_VERSION 70. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
Oh, did you recently upgrade your Node.js version? If so, you'll need to rebuild your native modules.
What happened when you ran npm rebuild
or npm install
?
npm install was what I ran to get in this situation :p and running it again or rebuild
didn't change anything :/
Yeah updated to 13.6 today, but my system seems to have updated to 13 in november (haven't used cabal since then but other stuff)
Sorry, I didn't notice that your error was about cabal-desktop. My guess is that's an Electron thing, you probably need npm run postinstall
for that (and make sure you're starting it with Electron 5, not Node.
Anyway, I think it would probably be best to have you try to npm install
in sodium-native and file an issue there if it doesn't work with Node 13.
Yep opened a new issue there now sodium-friends/sodium-native#117
Uncaught Error: The module '/home/me/prj/web/cabal-desktop/node_modules/sodium-native/build/Release/sodium.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 79. This version of Node.js requires
NODE_MODULE_VERSION 70. Please try re-compiling or re-installing
the module (for instance, usingnpm rebuild
ornpm install
).
Electron comes with node v12 but when you install node modules prebuild binaries will be downloaded for the nodejs version used. This is why you get the above-quoted error when you execute the Electron app.
Try running npx electron-builder install-app-deps
being located in the project folder. That should download prebuilds binaries or compile them for the Electron version used. If no luck then I'd recommend trying performing these steps:
- remove
./node_modules/prebuild-install
just to make sure prebuild binaries won't be downloaded/used. - remove
./node_modules/keytar/build
and./node_modules/keytar/prebuilds
- execute
npx electron-builder install-app-deps