Unofficial Node.js Wheel
nodejs-wheel is an unofficial Python package that distributes prebuilt Node.js binaries as wheels on PyPI. It enables Python projects to declare and install Node.js as a dependency via `pip`, providing access to `node`, `npm`, and `npx` commands within a Python environment. The current version, 24.14.1, was released on March 31, 2026, and the project generally follows the Node.js release schedule, which sees new major versions biannually in April and October. It supports Python 3.7 and above.
Warnings
- gotcha This is an unofficial distribution of Node.js. While it aims to provide official binaries, users should be aware that it's not maintained by the official Node.js project.
- breaking Upgrading major versions of `nodejs-wheel` (which correspond to Node.js major versions) may introduce breaking changes from Node.js itself, including changes to platform support (e.g., macOS minimum versions, 32-bit OS deprecation), OpenSSL versions, and core API behaviors. For example, Node.js v24 deprecated 32-bit Windows and armv7 Linux binaries, and requires macOS 13.5+ for pre-built binaries.
- gotcha For installations where only the Node.js binaries are needed and Python API/CLI integration is not desired, consider installing `nodejs-wheel-binaries` directly. This avoids installing the full `nodejs-wheel` package, which acts as a wrapper and adds CLI entry points.
- gotcha When using the Python API (e.g., `node()`, `npm()`), the functions by default return the exit code (an `int`). To get a `subprocess.CompletedProcess` object for richer output, error stream, and process handling, pass `return_completed_process=True` to the function call.
- gotcha Node.js applications, whether executed via this package or directly, can be prone to common issues like blocking the event loop with synchronous operations, unhandled asynchronous errors (Promise rejections), and module not found errors.
Install
-
pip install nodejs-wheel -
pip install nodejs-wheel-binaries
Imports
- node
from nodejs_wheel import node
- npm
from nodejs_wheel import npm
- npx
from nodejs_wheel import npx
- corepack
from nodejs_wheel import corepack
Quickstart
import os
from nodejs_wheel import node, npm
# Run a Node.js command and get the exit code
node_version_exit_code = node(['--version'])
print(f'Node.js --version exit code: {node_version_exit_code}')
# Run a Node.js command and get the CompletedProcess object for detailed output
node_version_process = node(['--version'], return_completed_process=True)
print(f'Node.js version: {node_version_process.stdout.strip()}')
# Run an npm command
npm_version_process = npm(['--version'], return_completed_process=True)
print(f'npm version: {npm_version_process.stdout.strip()}')