# Installation (/docs/installation)



Install from npm (recommended) [#install-from-npm-recommended]

```bash
npm install -g snpm
```

The npm package downloads a pre-built native binary for your platform and exposes:

* `snpm` — the primary CLI.
* `spx` — a shorthand for `snpm dlx`.

Supported platforms: macOS, Linux, and Windows on `x64` and `arm64`. Node.js 18+ is required for the install script.

Install from a GitHub Release [#install-from-a-github-release]

Native binaries are published for each release at [github.com/binbandit/snpm/releases](https://github.com/binbandit/snpm/releases). Download the archive for your platform and place the `snpm` (and optionally `snpm-switch`) binaries on your `PATH`.

Build from source [#build-from-source]

If you want to track `main` or contribute:

**Prerequisites**

* Rust toolchain — install from [rustup.rs](https://rustup.rs/).
* Git.

```bash
git clone https://github.com/binbandit/snpm.git
cd snpm

cargo install --path snpm-cli --force
cargo install --path snpm-switch --force   # optional: pinned packageManager support
```

This installs `snpm` and (optionally) `snpm-switch` into your Cargo bin directory (usually `~/.cargo/bin`).

Verify [#verify]

```bash
snpm --version
snpm config
```

`snpm config` prints the resolved cache/data paths, registry, install settings, allow-scripts list, and logging configuration.

Pin snpm per project [#pin-snpm-per-project]

`snpm-switch` honors the `packageManager` field in `package.json` and downloads the requested `snpm` build on demand:

```json title="package.json"
{
  "packageManager": "snpm@2026.5.16"
}
```

Helpful commands:

```bash
snpm switch which                       # show the resolved snpm binary
snpm switch cache                       # inspect/clear the version cache
snpm switch list                        # list cached snpm versions
snpm --switch-version 2026.5.16 install # one-off override
snpm --switch-ignore-package-manager install
```

When the npm shim is installed, it automatically prefers `snpm-switch` if it is available.

Update [#update]

```bash
# npm install
npm update -g snpm

# from source
cd snpm
git pull
cargo install --path snpm-cli --force
```

Uninstall [#uninstall]

```bash
# npm install
npm uninstall -g snpm

# cargo install
cargo uninstall snpm-cli
cargo uninstall snpm-switch
```

To also reclaim the on-disk store, run `snpm clean --all`.
