Skip to content
This repository was archived by the owner on Mar 16, 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.1.
  • 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.1-headers.tar.gz.
  3. decompress and copy everything under node/v22.22.1/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

You need to install docker first.

Recommended to run only in a local virtual machine environment.

# Create a normal user and set up home directories and empty passwd.
sudo useradd -m -s /bin/bash YOUR_NORMAL_USERNAME
sudo passwd -d YOUR_NORMAL_USERNAME

# Add this user to the docker group.
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.1 # don't forget startWith 'v'

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

su YOUR_SUDO_USER
mv /tmp/node-v22.22.1-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.

How to build x86 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.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.

Credits

About

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

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors