I am trying to include the sqlite3 package into my electron project. I I get this error:
have done postinstall. It runs correctly on nodejs.
node_modules/sqlite3/lib/binding/electron-v4.0-darwin-x64/node_sqlite3.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 64. This version of Node.js requires
NODE_MODULE_VERSION 69. Please try re-compiling or re-installing
the module (for instance, using npm rebuild or npm install).
I have the same issue with using sqlite on my developing app, The problem comes from Electron that's change the NODE_MODULE_VERSION to 69 refer to githup issue page to find more info https://github.com/electron/electron/pull/16687
I don't find a really working way to solve the problem for now just downgrade the electron and sqlite version to an older version should solve the problem and build the native module.
Related
I'm working on a little Electron.js app. I want to get information about active window so I came across npm package active-win. I get it working at Linux and OSx without problem, but on Windows I get version error.
UnhandledPromiseRejectionWarning: Error: The module '\\?\C:\...\git\in_sane_factory\desktop-app\node_modules\iconv\build\Release\iconv.node'was compiled against a different Node.js version using
NODE_MODULE_VERSION 108. This version of Node.js requires
NODE_MODULE_VERSION 106. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
The iconv package is needed for active-win in version above 2. Highest version and default to install is 2.3.5. Only other version that I manage to install was 2.3.4 and that did not solve anything.
I tried to npm install, npm rebuild, cloning iconv repository and installing this version manualy via npm install <path>.
I tried to install the right version of Node.js but by official version table, there is no version 106. I only manage to upgrade from 93 to 108.
I'm not really skilled Node.js user and now I'm trully hopeless. Do you have any advice or idea, what may solve this?
Sources:
My APP: https://gitlab.com/insanefactory/desktop-app
iconv NPM: https://www.npmjs.com/package/iconv
active-win NPM: https://www.npmjs.com/package/active-win
ref-wchar-napiNPM: https://www.npmjs.com/package/ref-wchar-napi
NPM releas version table: https://nodejs.org/en/download/releases/
Node.js version or version of package was not the issue in the end. After a few weeks I found out, where I was wrong. All needed to fix it was installing electron-rebuild and then running simple .\node_modules\.bin\electron-rebuild.cmd.
Hope, if you come across similar problem, this can help you as well.
I think you are basically running a different nodejs version on your windows machine. Cross check with the version on your Mac to confirm.
I'm trying to use node's tree-sitter package in my vscode extension, but I get the following error:
Activating extension 'extension name' failed: The module '.../node_modules/tree-sitter/build/Release/tree_sitter_runtime_binding.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 93. This version of Node.js requires
NODE_MODULE_VERSION 89. Please try re-compiling or re-installing
the module (for instance, using npm rebuild or npm install)..
From what I understand, the NODE_MODULE_VERSION is the version of node's ABI. However, I couldn't even find a release of node that has NODE_MODULE_VERSION 89 in the official website.
What I've tried:
Deleting the node_modules folder and reinstalling the packages.
Running npm rebuild tree-sitter --update-binary from the top directory.
Rebuilding the tree-sitter package with node-gyp rebuild and node-gyp rebuild --target=(my node version) from the node_modules/tree-sitter directory.
Switching node versions using nvm.
None of that helped. I understand from here that changing node versions won't help, as I confirmed when I tried
console.log(process.version); // v14.16.0
console.log(process.versions.modules); // 89
This gave the same output no matter which node version I used. I also tried rebuilding the tree-sitter package using that node version node-gyp rebuild --target=14.16.0, but I get the same error, however this time it says the module was compiled using NODE_MODULE_VERSION 83, which is consistent with what node's site says.
How do I resolve this error?
Any help is appreciated.
As I suspected, the version of node ABI used by vscode extensions is the ABI version used by vscode's internal electron. According to this source
Native Node.js modules are supported by Electron, but since Electron has a different application binary interface (ABI) from a given Node.js binary (due to differences such as using Chromium's BoringSSL instead of OpenSSL), the native modules you use will need to be recompiled for Electron...
This explains why I couldn't find NODE_MODULE_VERSION 89 in node's site.
Next, I checked what version of electron my build of vscode uses. To do this, I simply checked the package.json that came with vscode (/usr/lib/code/package.json on linux, I guess that it is inside the folder vscode is installed on on windows).
Next, following the instructions from electron's site, rebuild the module using the package electron-rebuild. To specify a target version, simply run
./node_modules/.bin/electron-rebuild -v [version]
However, I have no source for this but it seems that tree-sitter does not currently support newer versions of electron, so the build fails. This seems to be because of a change in V8's API (according to this).
The author linked his solution here. I copied his changes and the build succeeded.
Note that I had to replace the existing node addon with the newly built one.
Trying to learn angular recently, but I am stuck in an error of angular. So here it is.
I am using Ubuntu 18.04, installed node latest version via nvm.
But I have "two" nodes in Ubuntu,[default] nodejs which is v8 now, and the node v13.
When I try to create angular project with ng new my-first-project it runs good, but it keeps warning of some deprecated dependencies for example core-js. I upgraded core-js to the latest(forced using sudo). But the deprecation warning did not disappear, I thought to use sudo ng new my-first-project but this time it brings me error
You are running version v8.10.0 of Node.js, which is not supported by Angular CLI 8.0+.
The official Node.js version that is supported is 10.9 or greater.
Please visit https://nodejs.org/en/ to find instructions on how to update Node.js.
How can I change angular's using nodejs -> node?
You have two Node.js versions installed with nvm, v8 and v13. It seems that Node.js v8 is active, you can check this with node --version command line command. If the version is really v8 you have to change it with nvm to v13 using nvm use 13.{x.x} command. The {x.x} should be the concrete installed version. If you don't know the installed versions by heart you can check them with nvm list command line command.
If you change the active Node.js version to v13 with nvm it will be used by Angular CLI and you won't get the above mentioned error.
2019-04-04T04:34:49.035Z - error: Error when loading extension Error: The module '/media/vishesh/Disc/working/examples/jsreport_pdf_password_install_tryout/node_modules/jsreport-pdf-password/node_modules/hummus/binding/hummus.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 51. This version of Node.js requires
NODE_MODULE_VERSION 57. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
Error: The module '/media/vishesh/Disc/working/examples/jsreport_pdf_password_install_tryout/node_modules/jsreport-pdf-password/node_modules/hummus/binding/hummus.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 51. This version of Node.js requires
NODE_MODULE_VERSION 57. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
I have tried downgrading node version using nvm. I have successfully done it and reduce to the required version (i.e)8.9.1. Thus when i check the command "node -v" i get 8.9.1.
But when i check "nodejs -v" i only get 11.9.0. Thus the above mentioned error occurred. I am unable to identify how to change the nodejs version also ? Any ideas ?
Also, i have tried installing "jsreport-pdf-password" with same version 11.9.0 in node and nodejs in a completely different folder and also by deleting the node_modules. Still getting this error.
After downloading node version using the command nvm install 8.9.1, it will download that version but won't use it. To use version 8.9.1 you have to run another command nvm use 8.9.1. Then your node version manager will start to use 8.9.1.
I got it. I searched in stackoverflow for a while and got in a post that node is the alias used by npm for nodejs. The nodejs is alias of nodejs version that the ubuntu os installs. Thus i removed the nodejs using this command "sudo apt-get remove nodejs".
Then i used nvm and set 7.10.0 as default node version. Later installed the package jsreport-pdf-password and ran the code. Now there was no error in run time regarding any version missmatch.
As far as the package is conserned it requires node version 7 and anything above or below, the error in question occurs. I tried to even rebuild the package at a later version but it did not solve the issue. Thus i recommend not to use this package if your node version is greater than 7.
I'm upgrading my Node js application from version 8 to version 10
suddenly when i tried to run the application it throws an error with the description bellow
cannot load the oracledb add-on binary for Node.js 10.9.0 (win32, x64)
NODE_MODULE_VERSION 57. This version of Node.js requires
NODE_MODULE_VERSION 64. Please try re-compiling or re-installing the
module (for instance, using npm rebuild or npm install).
Node-oracledb installation instructions:
https://oracle.github.io/node-oracledb/INSTALL.html
if i downgrade my nodejs to version 8, it works like a charm, my application uses some version 10 features that recently added
i have tried to remove all modules and then i typed npm install in order to reinstall modules properly i got failed with message above.
i also tried to follow node js installation with no luck, what should i do ?