Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for Node.js v20 Compatibility #28

Open
matvejs16 opened this issue Oct 6, 2023 · 1 comment
Open

Update for Node.js v20 Compatibility #28

matvejs16 opened this issue Oct 6, 2023 · 1 comment

Comments

@matvejs16
Copy link

matvejs16 commented Oct 6, 2023

Issue Description:

The AmyrAhmady/samp-node repository currently does not support Node.js v20. This issue is created to request an update to ensure compatibility with Node.js v20.

Expected Behavior:

The samp-node package should be updated to work seamlessly with Node.js v20, allowing users to utilize the latest features and security updates provided by this version.

Additional Information:

Thank you for considering this request. We look forward to seeing samp-node become compatible with Node.js v20.

@matvejs16 matvejs16 changed the title Update for Node.js v20 LTS Compatibility Update for Node.js v20 Compatibility Oct 6, 2023
@dockfries
Copy link

dockfries commented Feb 9, 2024

It may also be possible not to upgrade and compile to the api level of node16 compatibility through something like swc, babel, esbuild.


Is there anyone who can help? The current LTS is v20.11.1.
need to update samp-node/deps: v8, node, uv

reference 60ffe2d

and I don't know the right build command to generate x86 libnode.dll/so, which is suitable for Linux and Windows so that samp-node doesn't crash.

node build : https://github.com/nodejs/node/blob/v20.x/BUILDING.md

https://nodejs.org/docs/latest-v20.x/api/embedding.html#c-embedder-api

For windows, if successful, you may get the following files, which are located forward under samp-node/deps/node/lib/Release/win32

.\vcbuild dll x86 openssl-no-asm
  • node/Release/libnode.dll
  • node/Release/libnode.lib
  • node/Release/lib/v8_libplatform.lib
  • node/Release/libv8_libbase.lib

for samp-node with node v20, should use std:c++17, not 14

samp build: wiki

git clone https://github.com/AmyrAhmady/samp-node
git submodule update --init
cd samp-node

mkdir build
cd build
cmake .. -A win32 # wiki does not prompt to set Win32, usually your system is x64, so it will not be built as x86

Anyway, I tried to build it, but it didn't go well.

For windows, there are a lot of C4251: v8 ... warnings, and although dll is eventually generated, it cannot be used properly.

For ubuntu, I use ./configure --dest-cpu ia32 --openssl-no-asm --shared to build node, and then encounter an error from deps/zlib.

If I don't bring the openssl-no-asm, it error aes/aes-586.S:3069: Error: junk at end of line, first unrecognized character is %'`.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants