{"id":15605,"library":"esbuild-linux-riscv64","title":"esbuild: JavaScript/CSS Bundler (Linux RISC-V 64-bit)","description":"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.","status":"active","version":"0.15.18","language":"javascript","source_language":"en","source_url":"https://github.com/evanw/esbuild","tags":["javascript"],"install":[{"cmd":"npm install esbuild-linux-riscv64","lang":"bash","label":"npm"},{"cmd":"yarn add esbuild-linux-riscv64","lang":"bash","label":"yarn"},{"cmd":"pnpm add esbuild-linux-riscv64","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"This package is a platform-specific binary (Linux RISC-V 64-bit) that the main `esbuild` package depends on. Users typically install `esbuild`, which then pulls in the correct `@esbuild/<platform>` package as an optional dependency. This package should not be installed directly unless explicitly managing platform binaries.","package":"esbuild","optional":false}],"imports":[{"note":"While `require` works for CommonJS, `esbuild`'s build function is asynchronous and returns a Promise, making `import` with `await` the preferred modern pattern, especially for plugin usage.","wrong":"const { build } = require('esbuild')","symbol":"build","correct":"import { build } from 'esbuild'"},{"note":"The `transform` API is used for in-memory code transformation and does not support plugins or bundling. It is ideal for minifying or transpiling single code strings.","wrong":"const transform = require('esbuild').transform","symbol":"transform","correct":"import { transform } from 'esbuild'"},{"note":"For TypeScript projects, import types separately to define build configurations without bundling them into the output.","symbol":"BuildOptions","correct":"import type { BuildOptions } from 'esbuild'"}],"quickstart":{"code":"import { build } from 'esbuild';\nimport { readFileSync, writeFileSync } from 'node:fs';\nimport { join } from 'node:path';\n\nconst entryPoint = join(process.cwd(), 'src/main.ts');\nconst outputDir = join(process.cwd(), 'dist');\nconst outputFile = join(outputDir, 'bundle.js');\n\nconst content = `\n  // src/main.ts\n  import { add } from './utils';\n  console.log('Hello from esbuild!');\n  const result = add(5, 3);\n  console.log('5 + 3 =', result);\n`;\n\nconst utilsContent = `\n  // src/utils.ts\n  export function add(a: number, b: number): number {\n    return a + b;\n  }\n`;\n\n// Create dummy source files for demonstration\nwriteFileSync(entryPoint, content);\nwriteFileSync(join(process.cwd(), 'src/utils.ts'), utilsContent);\n\n// Ensure output directory exists\nimport { mkdirSync } from 'node:fs';\nmkdirSync(outputDir, { recursive: true });\n\nasync function runBuild() {\n  try {\n    await build({\n      entryPoints: [entryPoint],\n      bundle: true,\n      outfile: outputFile,\n      platform: 'node',\n      format: 'esm',\n      target: 'es2022',\n      minify: true,\n      sourcemap: true,\n      logLevel: 'info',\n      external: ['node:fs', 'node:path'], // Mark Node.js built-ins as external\n    });\n    console.log('Build successful!');\n    const bundledCode = readFileSync(outputFile, 'utf-8');\n    console.log('\\n--- Bundled Code (truncated) ---');\n    console.log(bundledCode.substring(0, 500) + '...');\n  } catch (e) {\n    console.error('Build failed:', e.message);\n    process.exit(1);\n  }\n}\n\nrunBuild();\n","lang":"typescript","description":"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."},"warnings":[{"fix":"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.","message":"esbuild `v0.27.0` (and later minor releases) introduced deliberate backwards-incompatible changes, including updated Go compiler requirements impacting minimum Linux kernel and macOS versions. Always pin the exact version of `esbuild` in your `package.json` (e.g., `\"esbuild\": \"0.27.0\"`) or use a caret range that accepts only patch upgrades (`^0.26.0`, `~0.26.0`) to avoid unexpected breakages.","severity":"breaking","affected_versions":">=0.27.0"},{"fix":"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.","message":"esbuild is built in Go and relies on native executables for performance. Platform-specific binaries (like `esbuild-linux-riscv64`) are typically installed as optional dependencies. Issues can arise if the correct binary cannot be found or installed, or if npm flags like `--no-optional` or `--ignore-scripts` are used during installation, hindering esbuild's ability to download its binary fallback.","severity":"gotcha","affected_versions":">=0.15.0"},{"fix":"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.","message":"Unlike many other bundlers (e.g., Webpack), esbuild does not support external configuration files like `webpack.config.js`. All configurations must be passed either via command-line arguments or programmatically through its JavaScript/TypeScript API.","severity":"gotcha","affected_versions":"All"},{"fix":"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.","message":"When bundling for Node.js, built-in Node.js modules (like `fs`, `path`, `http`, `https`) are not automatically excluded and will result in build errors like `Could not resolve \"https\"`.","severity":"gotcha","affected_versions":"All"},{"fix":"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.","message":"esbuild's TypeScript loader performs transpilation only; it does not do type-checking. Type errors will not cause an esbuild build to fail, potentially leading to runtime issues.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-21T00:00:00.000Z","next_check":"2026-07-20T00:00:00.000Z","problems":[{"fix":"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.","cause":"The native esbuild binary for your platform was not correctly installed or could not be found, often due to network issues during installation or incorrect npm flags.","error":"Error: Cannot find module 'esbuild/lib/main' (or similar path)"},{"fix":"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.","cause":"esbuild could not locate the imported module. This usually means the module is not installed, misspelled, or esbuild's module resolution rules are not configured correctly for your project structure or specific module type.","error":"✘ [ERROR] Could not resolve \"some-module\" (src/index.js:3:19)"},{"fix":"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.","cause":"A syntax error exists in your source code, preventing esbuild from parsing it correctly.","error":"✘ [ERROR] Expected \";\" but found \"}\" (src/index.js:10:1)"},{"fix":"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.","cause":"The installed Node.js version does not meet the minimum requirement specified by esbuild's `engines` field (`\"node\": \">=12\"`).","error":"The \"esbuild\" command must be run with Node.js version 12 or higher."}],"ecosystem":"npm"}