Registry / devops / nodejs-wheel-binaries

nodejs-wheel-binaries

JSON →
library24.19.0pypypi✓ verified 24d ago

The `nodejs-wheel-binaries` library provides unofficial Node.js and npm binaries packaged as a Python wheel. This allows Python projects to easily access and execute Node.js without requiring a system-wide Node.js installation, particularly useful in isolated or CI/CD environments. The current version is 24.14.1, and it typically releases new versions corresponding to major Node.js updates.

pip install nodejs-wheel-binaries
INSTALL
IMPORT
SIG · NODEJS-WHEEL-BINAR
N
nodejs-wheel-binaries
devopspythonv24.19.0
Install
4.0s avg
Import
23ms
Disk
227MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v24.19.0 · pip install
no network on importno background threads
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
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.024s · 233.5MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 4.0s · import 0.022s · 224MB
227MB installed
● package 227MB
Code
Verified usage

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

node
from nodejs_wheel import node
from nodejs_wheel_binaries import find_nodejs_bin
npm
from nodejs_wheel import npm
npx
from nodejs_wheel import npx

This quickstart demonstrates how to locate the Node.js and npm executables provided by the package and then execute simple commands using `subprocess`. This is the primary way to interact with Node.js via this library.

import subprocess from nodejs_wheel_binaries import find_nodejs_bin, find_npm_bin # Find the Node.js executable node_bin = find_nodejs_bin() npm_bin = find_npm_bin() if node_bin: print(f"Node.js binary found at: {node_bin}") try: # Run a simple Node.js command to get its version result = subprocess.run([node_bin, '--version'], capture_output=True, text=True, check=True) print(f"Node.js version: {result.stdout.strip()}") # Example: Run a simple JS script directly js_code = "console.log('Hello from Node.js via Python!');" result = subprocess.run([node_bin, '-e', js_code], capture_output=True, text=True, check=True) print(f"Node.js script output: {result.stdout.strip()}") except FileNotFoundError: print("Node.js executable not found in PATH after discovery.") except subprocess.CalledProcessError as e: print(f"Error running Node.js command: {e}") print(f"Stderr: {e.stderr}") else: print("Node.js binary could not be found by the wheel.") if npm_bin: print(f"\nNPM binary found at: {npm_bin}") try: # Run a simple NPM command to get its version result = subprocess.run([npm_bin, '--version'], capture_output=True, text=True, check=True) print(f"NPM version: {result.stdout.strip()}") except subprocess.CalledProcessError as e: print(f"Error running NPM command: {e}") print(f"Stderr: {e.stderr}")
Debug
Known issues
gotchaThis library provides Node.js and npm binaries for execution, not a Python wrapper or API. You cannot `import nodejs` and call Python functions; you must use `subprocess` to run the discovered binaries (`node_bin`, `npm_bin`).
fix
Always use `find_nodejs_bin()` or `find_npm_bin()` to get the executable path, then execute it via `subprocess.run()`.
affects: All
gotchaThe package does not automatically add `node` or `npm` to your system's PATH. You must explicitly import and use `find_nodejs_bin()` and `find_npm_bin()` to locate the executables within the Python environment.
fix
Always retrieve binary paths using `from nodejs_wheel_binaries import find_nodejs_bin, find_npm_bin` and pass these paths to `subprocess` calls.
affects: All
gotchaOther Node.js ecosystem tools like `npx` or `yarn` are not directly provided by this wheel. If needed, you must install them globally using the `npm_bin` found by this package (e.g., `subprocess.run([npm_bin, 'install', '-g', 'npx'])`).
fix
Install additional Node.js tools via `npm install -g <tool-name>` using the `npm_bin` provided by `nodejs-wheel-binaries`.
affects: All
breakingWhile the Python library aims for stability, the included Node.js binary itself is subject to Node.js's release cycle. Changes in Node.js behavior, deprecations, or API shifts (e.g., in module resolution, core APIs) can break your Node.js code, even if the Python library still correctly provides the binary. This is especially relevant when updating to new major Node.js versions (e.g., v18 to v20, v20 to v22).
fix
When upgrading `nodejs-wheel-binaries` to a version that bundles a new major Node.js release, thoroughly test your Node.js scripts for compatibility with the new Node.js version. Consult Node.js release notes for breaking changes.
affects: All
Upgrade
Version history
24.19.0latest on PyPI · released Aug 19, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
5 hits · last 30 days
node
4
Resources