Install with NPM

Install in your project packages or globally.

$ npm install esbuild 
$ npm install esbuild --global

Use NPX

Or invoke with npx - which will do a fresh download for you each time. It goes quickly and allows you to leave esbuild out of dev dependencies list.

$ npx esbuild --help

Download a binary

Without using Node or Go (which ES Build it made with), you can download a pre-compiled binary.

You can download a pre-built binary easily from NPM using cURL. This is useful is you don’t have Node installed but still have JS files to process like for a frontend-based focused tool or a Deno app.

From docs.

Install binary with curl and unzip it:

$ curl -O https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.11.17.tgz
$ tar xf esbuild-darwin-64-0.11.17.tgz

Test it:

$ package/bin/esbuild --help

Move it to a bin directory:

$ mv package/bin/esbuild /usr/local/bin

Run from anywhere:

$ esbuild --help

Build from source

The website also supplies instructions for building from source with Go. But this is probably only needed if you’re developing changes to ES Build or have an unsupported architecture when looking for a downloadable binary file.