Build From Source
Software Dependencies
Section titled “Software Dependencies”- node.js 16+
- npm
- git
- GCC
- pkg-config
- cmake
- protoc (protobuf compiler) >= v3.20.0
- openssl
- openssl-dev
- rustup
Valkey installation
Section titled “Valkey installation”See the Valkey installation guide to install the Valkey server and CLI.
Build Instructions
Section titled “Build Instructions”-
Install Common Prerequisites
Section titled “Install Common Prerequisites”Terminal window sudo apt update -ysudo apt install -y git gcc pkg-config openssl libssl-dev unzip cmake python3# Install rustcurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shsource "$HOME/.cargo/env"# Check that the Rust compiler is installedrustc --versionInstall
Section titled “Install ziglang and zigbuild”ziglangandzigbuildTerminal window pip3 install ziglangcargo install --locked cargo-zigbuildTerminal window sudo yum update -ysudo yum install -y git gcc pkgconfig openssl openssl-devel unzip cmake wget tar python3# Install rustcurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shsource "$HOME/.cargo/env"# Check that the Rust compiler is installedrustc --versionInstall
Section titled “Install ziglang and zigbuild”ziglangandzigbuildTerminal window pip3 install ziglangcargo install --locked cargo-zigbuildTerminal window brew updatebrew install git gcc pkgconfig openssl cmake unzip python3# Install rustcurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shsource "$HOME/.cargo/env"# Check that the Rust compiler is installedrustc --versionInstall Protobuf Compiler
Section titled “Install Protobuf Compiler”Terminal window PB_REL="https://github.com/protocolbuffers/protobuf/releases"curl -LO $PB_REL/download/v29.1/protoc-29.1-linux-x86_64.zipunzip protoc-29.1-linux-x86_64.zip -d $HOME/.localexport PATH="$PATH:$HOME/.local/bin"protoc --versionTerminal window PB_REL="https://github.com/protocolbuffers/protobuf/releases"curl -LO $PB_REL/download/v29.1/protoc-29.1-linux-x86_64.zipunzip protoc-29.1-linux-x86_64.zip -d $HOME/.localexport PATH="$PATH:$HOME/.local/bin"protoc --versionTerminal window PB_REL="https://github.com/protocolbuffers/protobuf/releases"curl -LO $PB_REL/download/v29.1//protoc-29.1-osx-universal_binary.zipunzip protoc-29.1-osx-universal_binary.zip -d $HOME/.localexport PATH="$PATH:$HOME/.local/bin"protoc --versionOther platform-specific binaries can be found here.
-
Clone the repository
Section titled “Clone the repository”Terminal window mkdir -p $HOME/srccd $HOME/srcgit clone https://github.com/valkey-io/valkey-glide.gitcd valkey-glide -
Install Node.js and NPM
Section titled “Install Node.js and NPM”Terminal window sudo apt install -y nodejs npmTerminal window sudo yum install -y nodejsTerminal window sudo brew install -y nodejs -
Install NPM Dependencies
Section titled “Install NPM Dependencies”Terminal window cd nodenpm icd rust-clientnpm icd .. -
Terminal window # Release Mode, stripped of all debug symbols.# Optimized and minimized binary size.npm run build:releaseTerminal window # Build in release mode with debug symbols.# Optimized but large binary size.npm run build:benchmarkTerminal window # For testing purposes, optimized but fast build.npm run buildOnce building completed, you’ll find the compiled JavaScript code in the
./build-tsfolder. -
Run tests
Section titled “Run tests”Terminal window # Build first (required before testing)npm run build# Run standard tests (excluding server modules)npm test# Run tests with debugging optionsnpm run test:debug# Run minimal tests (faster subset of tests)npm run test:minimum# Run only server module tests (requires valkey modules)npm run test:modules -
Integrating the built GLIDE package into your project.
Section titled “Integrating the built GLIDE package into your project.”Add the package to your project using the folder path with:
Terminal window npm install <path to GLIDE>/node
Troubleshooting
Section titled “Troubleshooting”- If the build fails after running
npx tscbecauseglide-rsisn’t found, check if your npm version is in the range 9.0.0-9.4.1, and if so, upgrade it. 9.4.2 contains a fix to a change introduced in 9.0.0 that is required in order to build the library.