Skip to content
This repository was archived by the owner on Oct 18, 2025. It is now read-only.

dockfries/samp-node

 
 

Repository files navigation

samp-node

Forked from samp-node

Changes in this fork

  • Only can work with infernus.
  • Update Node.js to v22.20.0.
  • 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.
  • Updated github workflows.
    • Building based on ubuntu-latest means you may need a higher version of glibc.

Api

check here

How to build x86 samp-node

linux with docker

git clone https://github.com/dockfries/samp-node
# or ssh
# git clone [email protected]:dockfries/samp-node.git
cd samp-node
git submodule update --init

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

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

github actions

fork and run on github actions.

How to build x86 libnode for samp-node

NodeHeaders

example v22.x

download here.

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

Windows v22

git clone https://github.com/nodejs/node.git -b v22.x --depth 1
cd node
.\vcbuild x86 dll openssl-no-asm
cd out/Release # so you can get the libnode.dll & libnode.lib, windows need this two files.

Linux v22

  1. You need to install docker first.
  2. Create a normal user and set up home directories and passwd.
  3. Add this user to the docker group.
    1. sudo usermod -aG docker YOUR_NORMAL_USERNAME
su YOUR_NORMAL_USERNAME
/bin/bash

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/recipes/x86_22/
chmod +x ./run.sh
chmod +x ./should-build.sh

cd ~/Devel/unofficial-builds-home/unofficial-builds

bin/local_build.sh -r x86 -v v22.20.0 # don't forget startWith 'v'

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

su YOUR_SUDO_USER
mv /tmp/node-v22.20.0-linux-x86.tar.gz ~
# use anything like shell/sftp download this file
# 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`

after that, for local build samp-node, pls put your libnode into deps/node/lib/Release/win and deps/node/lib/Release/linux respectively.

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

Credits

About

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

Resources

Stars

Watchers

Forks

Languages

  • C++ 87.9%
  • CMake 9.8%
  • Shell 1.9%
  • Pawn 0.4%