esbuild is a modern, extremely fast JavaScript and CSS bundler and minifier written in Go, not JavaScript. It aims to significantly improve build tool performance by leveraging parallelism and low-level optimizations, often achieving speeds 10-100 times faster than other bundlers like Webpack or Rollup. Key features include built-in support for ES6 and CommonJS modules, TypeScript, JSX, tree-shaking, source maps, and minification. It provides a straightforward API for both CLI and programmatic use in JavaScript/TypeScript and Go. The main `esbuild` package dynamically installs platform-specific binaries; `esbuild-linux-riscv64` is one such binary for Linux RISC-V 64-bit architectures. The latest stable version of the core `esbuild` is 0.28.0 (as of April 2026), with frequent patch and minor releases addressing bugs and adding features. It is widely adopted, integrated into tools like Vite, Angular (since v17), Ruby on Rails (since v7), and Netlify Functions.
npm install esbuild-linux-riscv64Verified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to programmatically use esbuild to bundle a TypeScript project, including creating dummy source files, handling imports, and configuring common build options like minification, source maps, and output format for Node.js. It shows the asynchronous `build` API and basic error handling.
Update your `package.json` to pin `esbuild` to a specific version or use a patch-only range (e.g., `"esbuild": "~0.26.0"`) to ensure consistent builds across deployments. Review the `esbuild` changelog before upgrading major/minor versions to understand potential impact.
Ensure that `--no-optional` and `--ignore-scripts` are not used during `npm install esbuild`. If issues persist, manually ensure the correct `@esbuild/<platform>` package is installed or verify network access to `registry.npmjs.org` for fallback downloads. Check for relevant operating system requirements as `esbuild` updates its Go compiler.
Refactor build configurations into a dedicated JavaScript or TypeScript build script (e.g., `build.js` or `esbuild.config.ts`) using the `esbuild.build()` API, or manage all options directly via CLI flags. Plugins are only supported with the programmatic `build` API.
Explicitly mark Node.js built-in modules as external using the `external` option in your `build` configuration or via CLI (`--external:module-name`) to prevent esbuild from trying to bundle them. Also ensure `platform: 'node'` is set for Node.js targets.
Integrate a separate TypeScript type-checker (like `tsc --noEmit`) into your build pipeline alongside esbuild. Run type-checking as a distinct step, usually before or in parallel with the esbuild compilation, to catch type errors early.
Ensure you have a stable internet connection. Try running `npm install esbuild` without `--no-optional` or `--ignore-scripts`. If issues persist, manually verify the `@esbuild/<platform>` package is present in `node_modules` for your OS and architecture.
Verify the module is installed via `npm install` or `yarn add`. Check for typos in the import path. If it's a Node.js built-in, add it to `external` options. For complex resolutions, consider `alias` or `plugins` for custom handling.
Review the indicated file and line number. Ensure your JavaScript/TypeScript code adheres to correct syntax for the targeted ES version. Use a linter (e.g., ESLint) to catch syntax errors proactively.
Upgrade your Node.js environment to version 12 or higher. Use a Node Version Manager (nvm, fnm, volta) to easily switch and manage Node.js versions.