{"id":11462,"library":"node-win-x64","title":"Node.js Runtime for Windows x64","description":"This package provides a specific, pre-compiled Node.js runtime binary for Windows 64-bit systems. It allows developers to bundle a particular Node.js version as a project dependency, ensuring consistent execution environments without requiring a system-wide Node.js installation or relying on version managers. The package tracks various Node.js releases, with the version number (e.g., 24.15.0) directly corresponding to the Node.js version it contains. New major versions typically align with the official Node.js release schedule (April and October). This package is particularly useful for projects requiring strict control over their Node.js runtime, for CI/CD pipelines, or in environments where global Node.js installations are undesirable or restricted. It aims to provide a reliable, isolated Node.js environment within a project's `node_modules` directory.","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-win-x64","lang":"bash","label":"npm"},{"cmd":"yarn add node-win-x64","lang":"bash","label":"yarn"},{"cmd":"pnpm add node-win-x64","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This package provides a binary, not a JavaScript module. Access the Node.js executable directly from the `bin` directory within the installed package. The exact path may vary slightly by OS but typically includes `node.exe` on Windows.","wrong":"import { node } from 'node-win-x64';","symbol":"Node.js executable path","correct":"const { resolve } = require('path');\nconst nodeExecutable = resolve(__dirname, 'node_modules', 'node-win-x64', 'bin', 'node.exe');"},{"note":"When `node-win-x64` is installed as a dependency, `npm` (and `yarn`, `pnpm`) automatically add the `node_modules/.bin` directory to the PATH when running scripts. This means `node` in `package.json` scripts will resolve to the locally bundled binary.","wrong":"import node from 'node-win-x64/node';","symbol":"npm-provided 'node' command","correct":"npm install node-win-x64\n# Then, in package.json scripts:\n\"scripts\": {\n  \"start\": \"node script.js\"\n}"},{"note":"The `npx` command can directly execute the Node.js binary provided by the `node-win-x64` package without needing to specify its full path. This is useful for one-off commands or testing specific Node.js versions.","wrong":"npx node --version","symbol":"npx command","correct":"npx node-win-x64 --version\n# or to run a script:\nnpx node-win-x64 script.js"}],"quickstart":{"code":"{\n  \"name\": \"my-project\",\n  \"version\": \"1.0.0\",\n  \"scripts\": {\n    \"check-node-version\": \"node --version\",\n    \"run-script\": \"node my-script.js\"\n  },\n  \"dependencies\": {\n    \"node-win-x64\": \"24.15.0\"\n  }\n}\n\n// my-script.js\nconsole.log('Hello from Node.js bundled by node-win-x64!');\nconsole.log(`Node.js version: ${process.version}`);\nconsole.log(`Platform: ${process.platform}`);\nconsole.log(`Architecture: ${process.arch}`);\n\n// To run:\n// npm install\n// npm run check-node-version\n// npm run run-script","lang":"javascript","description":"Demonstrates how to install `node-win-x64` and use the bundled Node.js executable for project scripts via `package.json`."},"warnings":[{"fix":"Be explicit about which Node.js executable you are running. Use `npm run` for project-specific Node.js, or `npx node-win-x64` for direct execution of the bundled binary. Consider using `nvm-windows` for managing global Node.js versions if you need to frequently switch between them for system-wide commands.","message":"Installing `node-win-x64` as a local dependency means `npm` scripts will use this bundled Node.js version. However, global `node` or `npm` commands executed directly in the terminal (outside of `npm run` scripts) will still use your system's globally installed Node.js.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Always pin the exact version of `node-win-x64` in `package.json` to ensure deterministic builds. Regularly review Node.js release notes for breaking changes when updating the package version. Use `npm install node-win-x64@<version>` to specify.","message":"This package provides a specific Node.js version. If your project relies on features or APIs introduced in newer Node.js versions, or deprecated in older ones, ensure the `node-win-x64` version matches your requirements. Upgrading this package effectively upgrades your project's Node.js runtime.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Use `node-gyp rebuild` with the correct Node.js version in PATH if you are building native modules. Often, if `node-win-x64` is used in `npm` scripts, `node-gyp` will automatically pick up the local Node.js version. Ensure necessary build tools (like Visual Studio on Windows) are available if you are compiling native modules.","message":"When using `node-win-x64`, ensure that any native Node.js modules (C++ add-ons) in your project are compiled against the specific Node.js version bundled in this package. Mismatched Node.js and native module binaries can lead to runtime errors.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"If running inside an npm script, ensure `node-win-x64` is listed in `devDependencies` or `dependencies` in `package.json` and `npm install` has been run. If running directly in the terminal, use `npx node-win-x64 --version` or ensure your system's PATH includes the directory where the Node.js executable is located if you intend to use a global installation.","cause":"The `node` command could not be found in the system's PATH, likely because the package was not installed or the environment variable is not correctly configured for direct terminal use.","error":"Error: Command failed with ENOENT: node --version"},{"fix":"Exit the Node.js REPL (by pressing Ctrl+C twice or typing `.exit`) and run `npm` commands directly in your command prompt or PowerShell terminal. `npm` is a separate command-line tool, not an internal Node.js command.","cause":"Attempting to execute `npm` commands directly within the Node.js interactive interpreter (REPL) launched via `node.exe`.","error":"npm should be run outside of the node repl, in your normal shell."}],"ecosystem":"npm"}