Capacitor-NodeJS icon indicating copy to clipboard operation
Capacitor-NodeJS copied to clipboard

node.js upgrade

Open sce9sc opened this issue 2 years ago • 13 comments

First of all . very nice work.

I was wondering if there is a way to upgrade the node.js version . I saw that the current version is v12.19.0.

I am not familiar with android but I was wondering if by upgrading the libnode will do . Please tell me if I can help . Node.js v17 and v18 have many nice features

sce9sc avatar May 24 '22 14:05 sce9sc

Unfortunately its not possible to upgrade the NodeJS engine (for now) because the creator of nodejs-mobile doesn't maintain the project anymore.

I plan to fork the repository this summer or fall, to provide the latest NodeJS versions (maybe with a script in the plugin so you can choose your preferred node version).

hampoelz avatar May 24 '22 16:05 hampoelz

Good News!

Recently two new PRs were opend in the nodejs-mobile repo to bump the node version to v16 and v18:

  • https://github.com/nodejs-mobile/nodejs-mobile/pull/3
  • https://github.com/nodejs-mobile/nodejs-mobile/pull/7

Once the PRs are merged I will update the nodejs part of this CapacitorJS plugin.

hampoelz avatar Nov 11 '22 07:11 hampoelz

Version 1.0.0-beta.2 has just been released, which is now based on node.js v16.17.1.

hampoelz avatar Jan 29 '23 23:01 hampoelz

That is fantastic. I will try it . thank you

sce9sc avatar Jan 31 '23 09:01 sce9sc

https://github.com/nodejs-mobile/nodejs-mobile/releases/tag/v18.17.1 was just released

ghost avatar Oct 14 '23 01:10 ghost

@jrobeson A new version with Node.js 18 will be released in the next few days.

hampoelz avatar Oct 17 '23 04:10 hampoelz

I noticed that for the react-native plugin they rewrote the integration to use v8, but there should be a way to just re-enable linkedBinding instead of having to move away from using n-api. It would be nice to find a node dev to talk to see if we can solve this better.

jadejr avatar Nov 29 '23 02:11 jadejr

@jadejr I actually planned to completely rework the native bridge anyway because I'm not satisfied with the current state. At the moment it's still a copy-pasta of the old Cordova plugin, as I had no C/C++ experience a few years ago when I started with the plugin.

Originally I planned the rework for next year as I don't have that much time at the moment. If we can't reuse the current code for nodejs-mobile v18.x, the corresponding release of this plugin will be delayed. If this is really the case, I could temporarily take over some parts of the react-native plugin bridge until I have more time for the full rework.

hampoelz avatar Dec 03 '23 09:12 hampoelz

@hampoelz: What would it take to just use the updated cordova version as done here? https://github.com/okhiroyuki/nodejs-mobile-cordova/pull/26

jadejr avatar Dec 11 '23 22:12 jadejr

The plugin now ships with nodejs-mobile v18.17.2. Sorry for the long delay.

For the future, I plan to create some workflows for automated tests and upgrades to provide the plugin faster with newer Node.js versions.

hampoelz avatar Jan 15 '24 11:01 hampoelz