Node.js Runtime for Windows x64
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.
Common errors
-
Error: Command failed with ENOENT: node --version
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.fixIf 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. -
npm should be run outside of the node repl, in your normal shell.
cause Attempting to execute `npm` commands directly within the Node.js interactive interpreter (REPL) launched via `node.exe`.fixExit 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.
Warnings
- gotcha 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.
- breaking 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.
- gotcha 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.
Install
-
npm install node-win-x64 -
yarn add node-win-x64 -
pnpm add node-win-x64
Imports
- Node.js executable path
import { node } from 'node-win-x64';const { resolve } = require('path'); const nodeExecutable = resolve(__dirname, 'node_modules', 'node-win-x64', 'bin', 'node.exe'); - npm-provided 'node' command
import node from 'node-win-x64/node';
npm install node-win-x64 # Then, in package.json scripts: "scripts": { "start": "node script.js" } - npx command
npx node --version
npx node-win-x64 --version # or to run a script: npx node-win-x64 script.js
Quickstart
{
"name": "my-project",
"version": "1.0.0",
"scripts": {
"check-node-version": "node --version",
"run-script": "node my-script.js"
},
"dependencies": {
"node-win-x64": "24.15.0"
}
}
// my-script.js
console.log('Hello from Node.js bundled by node-win-x64!');
console.log(`Node.js version: ${process.version}`);
console.log(`Platform: ${process.platform}`);
console.log(`Architecture: ${process.arch}`);
// To run:
// npm install
// npm run check-node-version
// npm run run-script