Registry / devops / node
library2.0.0jsnpmunverified

This package, `node`, facilitates the management and usage of specific Node.js runtime versions as a local project dependency. By installing it, a `node` binary is placed within `node_modules/.bin`, which npm automatically adds to the `PATH` when running scripts, ensuring that local project scripts consistently execute with the intended Node.js version, distinct from the system's globally installed Node.js. The current stable version provided through `node@lts` aligns with the latest Node.js LTS release, currently `24.15.0` as of its recent publication. The package generally follows Node.js's traditional release cadence, with major versions being branched every six months and even-numbered versions typically becoming LTS. This approach provides a robust alternative to global version managers (like `nvm` or `volta`) for project-specific environments, simplifying CI/CD setups and team development by treating the runtime as a regular `package.json` dependency. Releases track Node.js major versions, offering flexibility to target specific versions (e.g., `node@18`, `node@20`, `node@lts`) through `npm i` or `npx` commands.

npm install node
INSTALL
IMPORT
SIG · NODE
N
node
devopsjavascriptv2.0.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

node (in npm scripts)
{ "scripts": { "start": "node index.js" } }
import { node } from 'node';
This package provides a command-line executable, not JavaScript modules. Incorrectly attempting to 'import' or 'require' 'node' as a module will fail. npm scripts correctly place the local binary in PATH.
node (npx execution)
npx node@lts your-script.js
node your-script.js
npx provides a convenient way to execute specific versions of the 'node' binary without local installation, or to temporarily use a locally installed version. Always specify the version for clarity, e.g., 'node@lts' or 'node@20', as omitting it might use a global or cached version.
node (direct local binary)
./node_modules/.bin/node your-script.js
node your-script.js
After 'npm i node', the executable is placed in './node_modules/.bin/'. Directly invoking 'node' without 'npm run' or 'npx' will only work if './node_modules/.bin/' is manually added to your shell's PATH, which is generally not recommended for project-specific binaries.

Demonstrates installing a local Node.js binary and running a simple script with it via `npm start`, confirming the `process.version` and `process.execPath` to verify local execution. Also shows ad-hoc `npx` usage.

// package.json // { // "name": "my-local-node-project", // "version": "1.0.0", // "scripts": { // "start": "node index.js", // "check-local-node": "node -v" // } // } // 1. Install the latest LTS version of Node.js locally // npm will place the 'node' executable in ./node_modules/.bin/ npm i node@lts // 2. Create an 'index.js' file: // index.js import { readFileSync } from 'node:fs'; // Using 'node:' prefix for clarity import { join } from 'node:path'; // This confirms the version of Node.js that is executing this script console.log(`Hello from Node.js version: ${process.version}`); console.log(`Node.js executable path: ${process.execPath}`); // Example: Reading a local file const packageJsonPath = join(process.cwd(), 'package.json'); const packageJsonContent = readFileSync(packageJsonPath, 'utf8'); console.log('Successfully read package.json:', JSON.parse(packageJsonContent).name); // 3. To run this script using the locally installed Node.js via npm script: // npm start // 4. You can also use npx to run a specific version ad-hoc: // npx node@20 -e "console.log(process.version)"
node --version
Debug
Known issues
breakingInstalling 'node' globally with npm@2 will fail due to npm's internal removal process, which attempts to remove the package before its installation scripts can run, causing a conflict.
fix
Upgrade npm to version 3 or higher before attempting global installation, or install 'node' locally within a project's `devDependencies`.
affects: <3.0.0
gotchaAfter local installation (`npm i node`), the `node` command in your terminal's global PATH will still refer to your system's globally installed Node.js. The locally installed binary is only automatically used within `npm run` scripts or when explicitly invoked via `npx` or its full path.
fix
Always use `npm run <script-name>` for scripts defined in `package.json` or `npx node@<version> <command>` for ad-hoc execution to ensure the project's local Node.js version is used.
affects: >=1.0.0
gotchaWhen using `npx node <script.js>` without a version specifier (e.g., `@lts`, `@20`), `npx` might use a globally installed Node.js, a different locally cached version, or prompt to install the latest available, potentially leading to inconsistent environments.
fix
Always specify the desired Node.js version when using `npx`, e.g., `npx node@lts myscript.js` or `npx node@20 myscript.js`, to guarantee the intended runtime.
affects: >=1.0.0
Errors
Common errors & fixes
Error: command not found: node
Attempting to run 'node script.js' directly in the shell after local installation without using 'npm run' or 'npx'.
fix
Use 'npm run <script-name>' if the script is defined in `package.json`, or 'npx node@lts script.js' for ad-hoc execution. Alternatively, use './node_modules/.bin/node script.js'.
npm ERR! code EEXIST
Conflicting global installation when using older npm versions or environmental issues.
fix
Ensure `npm` is updated to a modern version (>=3.0.0). If installing globally, consider using `npm i --force` cautiously, or preferably, install the `node` package locally as a project dependency to avoid global conflicts.
npm WARN npm npm does not support Node.js <current-node-version>
The installed npm version is incompatible with the currently active Node.js runtime, often seen when switching Node.js versions or having an outdated npm.
fix
Update npm by running `npm install -g npm@latest` using a compatible Node.js version, or ensure your Node.js environment matches the npm's requirements.
Upgrade
Version history
2.0.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
17 hits · last 30 days
node
16
Resources
node — npm install node · libregistry