{"id":10806,"library":"esbuild-netbsd-64","title":"esbuild NetBSD AMD64 Binary","description":"esbuild is an extremely fast JavaScript bundler and minifier, renowned for its high performance due to its implementation in Go and compilation to native code. It offers comprehensive support for JavaScript, TypeScript, JSX, and CSS, providing essential features such as bundling, minification, tree-shaking, and a development server. The `esbuild-netbsd-64` package specifically delivers the pre-built NetBSD AMD64 executable for the core esbuild tool. Users typically install the main `esbuild` package, which then intelligently selects and installs the appropriate platform-specific binary (like this one) as an optional dependency. The current stable version is approximately 0.28.0, with a rapid release cadence marked by frequent patch and minor updates.","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-netbsd-64","lang":"bash","label":"npm"},{"cmd":"yarn add esbuild-netbsd-64","lang":"bash","label":"yarn"},{"cmd":"pnpm add esbuild-netbsd-64","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"This package provides the platform-specific executable for the main 'esbuild' package, which consumes this binary to run on NetBSD systems.","package":"esbuild","optional":true}],"imports":[{"note":"The esbuild API is predominantly designed for ES Modules. While 'require' may function in some CommonJS environments, direct ESM usage is the idiomatic and recommended approach for modern Node.js projects. Ensure your `package.json` specifies `\"type\": \"module\"` or use `.mjs` file extensions for direct ESM imports.","wrong":"const { build } = require('esbuild')","symbol":"build","correct":"import { build } from 'esbuild'"},{"note":"Most esbuild API functions are provided as named exports. There is no default export for the API module, and attempting to destructure functions from a non-existent default import will result in an error.","wrong":"import esbuild from 'esbuild'; esbuild.transform","symbol":"transform","correct":"import { transform } from 'esbuild'"},{"note":"The synchronous `buildSync` function is a named export. While useful for CLI tools or specific blocking scenarios, synchronous API calls are generally discouraged for long-running operations in Node.js as they block the event loop. Prefer the asynchronous `build` function when possible.","wrong":"import { build } from 'esbuild'; build.sync()","symbol":"buildSync","correct":"import { buildSync } from 'esbuild'"}],"quickstart":{"code":"import { build } from 'esbuild';\nimport path from 'path';\n\nconst projectRoot = process.cwd();\nconst entryPoint = path.join(projectRoot, 'src', 'index.ts');\nconst outFile = path.join(projectRoot, 'dist', 'bundle.js');\n\nasync function runBuild() {\n  console.log(`Starting build for ${entryPoint}...`);\n  try {\n    await build({\n      entryPoints: [entryPoint],\n      bundle: true,\n      minify: true,\n      sourcemap: true,\n      outfile: outFile,\n      platform: 'node', // Can be 'browser', 'node', or 'neutral'\n      target: ['es2020', 'node18'], // Specify target environments\n      logLevel: 'info',\n      banner: { js: '// Built by esbuild on ' + new Date().toISOString() },\n      define: {\n        'process.env.NODE_ENV': '\"production\"', // Define global constants\n        '__APP_VERSION__': '\"1.0.0\"' // Example custom constant\n      },\n      external: ['lodash', 'axios'], // Exclude these packages from the bundle\n    });\n    console.log(`Build successful: ${entryPoint} -> ${outFile}`);\n  } catch (error) {\n    console.error('Build failed with errors:', error);\n    process.exit(1);\n  }\n}\n\nrunBuild();","lang":"typescript","description":"This quickstart demonstrates how to programmatically use esbuild's `build` API to bundle, minify, transpile TypeScript, generate sourcemaps, and define environment-specific constants for a Node.js target, illustrating a common build setup."},"warnings":[{"fix":"Review the specific release notes for breaking changes before upgrading. Pin exact versions (`\"esbuild\": \"0.27.0\"`) or use dependency management tools with lockfiles to control updates.","message":"Version 0.27.0 introduced deliberate backwards-incompatible changes. To prevent unexpected breakage, it is strongly recommended to pin the exact `esbuild` version in `package.json` (e.g., `'esbuild': '0.26.0'`) or restrict updates to patch-level releases using tilde/caret ranges carefully (e.g., `'esbuild': '~0.26.0'` but be aware this might still pull in breaking changes for versions like 0.27.x if used with ^0.26.0).","severity":"breaking","affected_versions":">=0.27.0"},{"fix":"Consult NetBSD-specific Node.js documentation or community forums for best practices regarding Node.js compatibility and stability on the platform. Consider using an officially supported platform if guaranteed behavior is critical for your application.","message":"NetBSD is not among Node.js's officially supported platforms. While `esbuild-netbsd-64` provides the necessary binary, its stability and full functionality may vary depending on the specific Node.js installation and patches on the NetBSD system. This is a platform-level consideration, not a direct fault of esbuild itself.","severity":"gotcha","affected_versions":">=0.15.18"},{"fix":"Upgrade to esbuild v0.27.5 or a later version to ensure correct handling and minification of CSS media queries.","message":"Several regressions were identified and fixed in previous versions related to CSS media query parsing and minification. Specifically, versions from `0.25.11` to `0.27.4` might have produced incorrect output or failed to properly handle certain media query structures (e.g., `or` clauses), as well as issues with removal of duplicate rules during minification.","severity":"gotcha","affected_versions":">=0.25.11 <0.27.5"},{"fix":"Upgrade to esbuild v0.27.5 or a newer version to resolve the async generator concurrent polling bug.","message":"An issue existed where async generators transformed by esbuild did not function correctly when polled concurrently (e.g., using `yield* inner()`), specifically for versions from `0.19.0` until `0.27.5`. This could lead to unexpected runtime behavior.","severity":"gotcha","affected_versions":">=0.19.0 <0.27.5"},{"fix":"Upgrade to esbuild v0.27.1 or a later version to ensure correct hoisting behavior for `var` declarations in bundled code.","message":"A specific bundler bug in versions prior to `0.27.1` caused incorrect hoisting of `var` declarations that were nested inside an `if` statement, particularly when an ES module was imported using `require` (which wraps it). This could lead to runtime errors.","severity":"gotcha","affected_versions":">=0.15.18 <0.27.1"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Check your npm installation logs for errors related to 'esbuild-YOUR_PLATFORM' (e.g., `esbuild-netbsd-64`). Try clearing npm cache (`npm cache clean --force`) and reinstalling esbuild. Ensure the binary has executable permissions (`chmod +x node_modules/esbuild/esbuild`). If on NetBSD, verify Node.js's ability to execute external binaries.","cause":"The esbuild binary could not be found or executed. This often indicates that the platform-specific binary package failed to install correctly (e.g., due to network issues, corrupted cache, or incompatible platform), or the binary lacks execute permissions.","error":"Error: spawnSync ./esbuild ENOENT"},{"fix":"If esbuild is a local dependency, use `npx esbuild ...` or define a script in your `package.json` (e.g., `\"build\": \"esbuild src/index.ts --bundle --outfile=dist/main.js\"`). If you intend to use it globally, ensure it was installed with `npm install -g esbuild` and your global npm bin directory is in your PATH.","cause":"The `esbuild` command-line executable is not available in your system's PATH. This typically happens when esbuild is installed as a local dependency and you're trying to run it directly from the terminal, or if a global installation failed.","error":"esbuild: command not found"},{"fix":"Update your code to use `import { build } from 'esbuild'` and ensure your Node.js project is configured for ES Modules. This typically involves adding `\"type\": \"module\"` to your `package.json` file or renaming your consuming file to have a `.mjs` extension.","cause":"You are attempting to load esbuild's main entry point (which is an ES Module) using Node.js's CommonJS `require()` function from a CommonJS context.","error":"Error: \"/path/to/project/node_modules/esbuild/lib/main.js\" is an ES module file cannot be 'require'd. Instead, change the requiring code to use 'import'"}],"ecosystem":"npm"}