Skip to content
This repository was archived by the owner on Jun 13, 2026. It is now read-only.

dockfries/samp-node

Repository files navigation

samp-node

Forked from AmyrAhmady/samp-node

Changes in this fork

  • Only can work with infernus.
  • Update Node.js to v22.22.3.
  • Both ESModule and CommonJS supported, depending on the type field of package.json and the bundler output format.
  • Only entry_file is used, resource config are removed.
  • Removed samp.fire to avoid crashes.
  • Building based on ubuntu-latest means you may need a higher version of glibc.
  • Updated github workflows.

Api

check here

How to pre-build x86 libnode binaries for samp-node

NodeHeaders

example v22.x

download here.

  1. delete everything under deps/node/include.
  2. download node-v22.22.3-headers.tar.gz.
  3. decompress and copy everything under node/v22.22.3/include/node to deps/node/include.

Windows v22

# x86 (32-bit)
git clone https://github.com/nodejs/node.git -b v22.x --depth 1
cd node
.\vcbuild x86 dll openssl-no-asm
cd out/Release # libnode.dll & libnode.lib

# x64 (64-bit)
.\vcbuild x64 dll openssl-no-asm
cd out/Release # libnode.dll & libnode.lib

Linux v22

You need to install docker first.

Recommended to run only in a local virtual machine environment.

x86 (32-bit) - requires unofficial-builds for cross-compilation

sudo useradd -m -s /bin/bash YOUR_NORMAL_USERNAME
sudo passwd -d YOUR_NORMAL_USERNAME
sudo usermod -aG docker YOUR_NORMAL_USERNAME
su YOUR_NORMAL_USERNAME

rm -fr ~/Devel/unofficial-builds-home
mkdir -p ~/Devel/unofficial-builds-home
cd ~/Devel/unofficial-builds-home

git clone https://github.com/dockfries/unofficial-builds
cd ~/Devel/unofficial-builds-home/unofficial-builds
chmod +x ./**/*.sh

bin/local_build.sh -r x86_22 -v v22.22.3 # don't forget startWith 'v'

cp ~/Devel/unofficial-builds-home/staging/release/v22.22.3/node-v22.22.3-linux-x86.tar.gz /tmp

su YOUR_SUDO_USER
mv /tmp/node-v22.22.3-linux-x86.tar.gz ~
# decompress it, you can see libnode.so.xxx in lib folder, that's what you need only.
# For version 22, `.so` files end with `127`

x64 (64-bit) - build from source

git clone https://github.com/nodejs/node.git -b v22.x --depth 1
cd node
./configure --shared --openssl-no-asm
make -j$(nproc)
# out/Release/libnode.so.127 is what you need

after that, for local build samp-node, pls put your libnode into paths below.

Local paths for libnode

Arch Windows Linux
x86 (default) deps/node/lib/Release/win/libnode.lib + libnode.dll deps/node/lib/Release/linux/libnode.so.127
x64 deps/node/lib/Release/win64/libnode.lib + libnode.dll deps/node/lib/Release/linux64/libnode.so.127

for build samp-node, see .github/workflows/build.yml.

How to build samp-node

linux with docker

git clone https://github.com/dockfries/samp-node
# or ssh
# git clone git@github.com:dockfries/samp-node.git
cd samp-node
git submodule update --init

chmod +x ./build.sh
./build.sh 22.22.3 # version

linux with cmake (x86 default)

cd samp-node
mkdir build && cd build

cmake -DCMAKE_BUILD_TYPE=Release ..
make -j$(nproc)

# for 64-bit:
# cmake -DPLUGIN_ARCH=x64 -DCMAKE_BUILD_TYPE=Release ..

windows with Visual Studio

cd samp-node
mkdir build, releases -ErrorAction SilentlyContinue
cd build

cmake .. -A Win32
cmake --build . --config Release
cpack

cd ..
Move-Item -Path "build/cpack/*" -Destination "releases/" -Force

# for 64-bit:
# cmake .. -A x64 -DPLUGIN_ARCH=x64

github actions

fork and run on github actions.

Credits

About

Legacy sa-mp plugin to run node.js scripts.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors