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.
pip install nodejs-wheelVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to import and execute Node.js and npm commands directly from Python. It shows how to retrieve both the exit code and the full `subprocess.CompletedProcess` object for more detailed output handling.
Verify the source and integrity if strict official guarantees are required. For production environments, consider official Node.js installation methods if this unofficial distribution poses a concern.
Refer to the official Node.js release notes for breaking changes and test thoroughly before upgrading. Ensure your environment meets the minimum requirements for the target Node.js version.
Use `pip install nodejs-wheel-binaries` if only binaries are required. If both `nodejs-wheel` and `nodejs-wheel-binaries` are installed, `nodejs-wheel`'s entry points will take precedence.
Modify API calls to `function_name(..., return_completed_process=True)` to receive the `CompletedProcess` object.
Adhere to Node.js best practices for asynchronous programming, error handling (e.g., `try-catch` with `async/await`, `.catch()` for Promises), and proper module resolution. Utilize Node.js-specific debugging tools when developing and testing Node.js code.
To execute Node.js commands from Python, use `python -m nodejs_wheel.node <args>` or `python -m nodejs_wheel.npm <args>`. If you need to call `node` or `npm` directly from your terminal, ensure your shell environment's PATH includes the directory where `nodejs-wheel` installs its executables (typically `your_venv/bin` or `your_venv/Scripts`). Reloading your shell or virtual environment often resolves this.
Instead of `import nodejs_wheel`, interact with the Node.js binaries using the provided Python entry points, e.g., `subprocess.run([sys.executable, '-m', 'nodejs_wheel.node', '--version'])` to run Node.js, or access utility functions like `nodejs_wheel.executable.node_path()` if you need the path to the executable programmatically.
Verify that your operating system, architecture, and Python version (Python 3.7+ is supported) are officially supported by `nodejs-wheel`. Check the package's PyPI page for available wheels. If no compatible wheel exists, consider installing Node.js manually or compiling it from source, or using a different environment where a compatible wheel is available.