{"id":14732,"library":"node-darwin-x64","title":"Node.js Runtime (macOS x64 Binary)","description":"The `node-darwin-x64` package provides a pre-compiled Node.js runtime specifically for macOS (x64 architecture), currently at version 24.15.0. It enables developers to include a specific Node.js version directly within their project's dependencies, facilitating consistent environments for builds, tests, or embedded applications without relying on a system-wide Node.js installation. Node.js itself is an open-source, cross-platform JavaScript runtime environment that follows a predictable release cadence. New major versions are released every six months in April and October, which may introduce breaking changes. Even-numbered major versions are designated as Long Term Support (LTS) releases, offering 12 months of active support followed by 18 months of maintenance, focusing on stability and security.","status":"active","version":"24.15.0","language":"javascript","source_language":"en","source_url":"https://github.com/aredridel/node-bin-gen","tags":["javascript"],"install":[{"cmd":"npm install node-darwin-x64","lang":"bash","label":"npm"},{"cmd":"yarn add node-darwin-x64","lang":"bash","label":"yarn"},{"cmd":"pnpm add node-darwin-x64","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This package provides the Node.js runtime environment. These are standard Node.js built-in module imports used *within* the provided runtime, not directly exported by `node-darwin-x64` itself. Use the `node:` protocol for clarity and future-proofing in ESM contexts.","wrong":"import fs from 'fs';","symbol":"fs","correct":"import fs from 'node:fs';"},{"note":"This package provides the Node.js runtime environment. These are standard Node.js built-in module imports used *within* the provided runtime, not directly exported by `node-darwin-x64` itself. While `require()` is valid in CommonJS, `import` with the `node:` protocol is preferred for modern ESM.","wrong":"const http = require('http');","symbol":"http","correct":"import { createServer } from 'node:http';"},{"note":"`process` is a global object in Node.js, often accessed directly without explicit import. However, for explicit declaration in ESM, `import process from 'node:process';` is the correct pattern. This package provides the Node.js runtime that makes `process` available.","wrong":"import { arch } from 'process';","symbol":"process","correct":"import process from 'node:process';"}],"quickstart":{"code":"import { execSync } from 'node:child_process';\nimport { writeFileSync, unlinkSync } from 'node:fs';\nimport { join } from 'node:path';\n\n// Create a simple script to demonstrate running Node.js\nconst scriptContent = `\n  console.log('Hello from Node.js (v' + process.version + ') provided by node-darwin-x64!');\n  console.log('Current architecture:', process.arch);\n  console.log('Current platform:', process.platform);\n  console.log('Environment variable GREETING:', process.env.GREETING ?? 'not set');\n`;\n\nconst scriptFilePath = join(process.cwd(), 'hello-node.js');\nwriteFileSync(scriptFilePath, scriptContent);\n\nconsole.log('Executing script using the Node.js runtime bundled by node-darwin-x64...');\n\ntry {\n  // Option 1: Using 'npx' (recommended for convenience)\n  // 'npx' automatically finds executables installed in node_modules/.bin\n  console.log('\\n--- Running via npx ---');\n  const outputNpx = execSync('npx node hello-node.js', {\n    env: { ...process.env, GREETING: 'Hello from npx' },\n    encoding: 'utf8', \n    stdio: 'pipe' // Capture output\n  });\n  console.log(outputNpx);\n\n  // Option 2: Directly referencing the binary path\n  // Useful for explicit control or when 'npx' is not available\n  const nodeBinaryPath = join(process.cwd(), 'node_modules', '.bin', 'node');\n  console.log(`\\n--- Running directly from ${nodeBinaryPath} ---`);\n  const outputDirect = execSync(`${nodeBinaryPath} hello-node.js`, {\n    env: { ...process.env, GREETING: 'Hello directly' },\n    encoding: 'utf8', \n    stdio: 'pipe' // Capture output\n  });\n  console.log(outputDirect);\n\n} catch (error) {\n  console.error('Error running script:', error.message);\n  if (error.stderr) console.error('Stderr:', error.stderr);\n} finally {\n  unlinkSync(scriptFilePath); // Clean up the temporary script\n  console.log('\\nCleaned up temporary script: hello-node.js');\n}","lang":"javascript","description":"This quickstart demonstrates how to execute a Node.js script using the specific `node` executable provided by the `node-darwin-x64` package, leveraging `npx` or direct path access."},"warnings":[{"fix":"Review the official Node.js release notes and migration guides for each new major version. Pin your project to a specific `node-darwin-x64` version to control the Node.js runtime until you are ready to upgrade and adapt your code.","message":"Node.js major versions, released every April and October, frequently introduce breaking changes. Projects relying on a specific Node.js version provided by this package should be prepared for potential incompatibilities when upgrading to a new major version.","severity":"breaking","affected_versions":">=24.0.0"},{"fix":"Always use `npx node <script.js>` to ensure the Node.js version bundled with the package is used, or explicitly call the executable at `$(npm bin)/node <script.js>` or `node_modules/.bin/node <script.js>`.","message":"This package provides a `node` executable in `node_modules/.bin`. If a system-wide Node.js installation is also present, or if your PATH is configured differently, you might inadvertently use the wrong Node.js version. This can lead to inconsistent behavior or build failures.","severity":"gotcha","affected_versions":">=24.0.0"},{"fix":"Understand that `node-darwin-x64` provides the Node.js *runtime executable*. To use Node.js features, you `import` or `require` built-in Node.js modules (e.g., `node:fs`, `node:http`) or third-party npm packages within the context of a script executed by the bundled Node.js.","message":"This package is a binary distribution and does not export any JavaScript modules directly. Attempts to `import` or `require` symbols directly from `'node-darwin-x64'` will result in errors.","severity":"gotcha","affected_versions":">=24.0.0"},{"fix":"Ensure your project's security practices include auditing third-party binary dependencies. Verify checksums if possible, or restrict usage to trusted CI/CD environments.","message":"As a binary distribution, this package downloads pre-compiled Node.js executables. This introduces a supply chain dependency on the integrity of the original Node.js binaries and the `aredridel/node-bin-gen` repository.","severity":"gotcha","affected_versions":">=24.0.0"}],"env_vars":null,"search_vec":"'12':111 '18':118 '24.15.0':27 'activ':114 'applic':51 'april':89 'architectur':23 'binari':5 'break':95 'build':47 'cadenc':79 'chang':96 'compil':16 'consist':44 'cross':69 'cross-platform':68 'current':24 'darwin':9 'depend':42 'design':103 'develop':30 'direct':37 'embed':50 'enabl':29 'environ':45,73 'even':98 'even-numb':97 'everi':85 'facilit':43 'focus':122 'follow':75,116 'includ':32 'instal':60 'introduc':94 'javascript':71,127 'long':105 'lts':108 'maco':3,21 'mainten':121 'major':81,100 'may':93 'month':87,112,119 'new':80 'node':8 'node-darwin-x64':7 'node.js':1,17,35,59,61 'number':99 'octob':91 'offer':110 'open':66 'open-sourc':65 'packag':11 'platform':70 'pre':15 'pre-compil':14 'predict':77 'project':40 'provid':12 'releas':78,84,109 'reli':53 'runtim':2,18,72 'secur':126 'six':86 'sourc':67 'specif':19,34 'stabil':124 'support':107,115 'system':57 'system-wid':56 'term':106 'test':48 'version':26,36,82,101 'wide':58 'within':38 'without':52 'x64':4,10,22","created_at":"2026-04-20T18:43:19.758770+00:00","updated_at":"2026-04-20T18:43:19.758770+00:00","problems":[{"fix":"Execute your script using `npx node your-script.js` or specify the full path to the bundled Node.js executable: `node_modules/.bin/node your-script.js`.","cause":"The system's PATH environment variable does not include the `node_modules/.bin` directory, or you are not using a tool like `npx` that resolves local binaries.","error":"sh: node: command not found"},{"fix":"For third-party modules, ensure `npm install some-module` has been run. For built-in modules, verify the correct module name and use the `node:` prefix (e.g., `node:fs`). If using ESM, check `package.json` for `\"type\": \"module\"` and correct import paths.","cause":"A required module (either built-in or third-party) cannot be found by the Node.js runtime. This could be due to a missing `npm install` for third-party modules or a typo in a built-in module name.","error":"Error: Cannot find module 'some-module'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"node","cli_version":null,"type":"library","homepage":"https://nodejs.org","github":"https://github.com/aredridel/node-bin-gen","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/node-darwin-x64","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-18","install_tag":null}}