You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
have_npm() / run_npm_install() never find npm on Windows (subprocess cannot resolve npm.cmd) #124
On Windows, readabilipy.utils.have_npm() always returns False even when Node.js and npm are installed and on PATH, so the Readability.js extraction path is unreachable on Windows and the pure-Python fallback is always used.
Environment
Windows 11 (build 26300), Python 3.13.14
readabilipy 0.3.0
Node.js and npm 11.17.0 installed and on PATH; node.exe, npm.cmd and npm.ps1 all present in the Node.js directory; npm --version works from the same shell that spawned Python
On Windows npm ships as npm.cmd / npm.ps1, not npm.exe. subprocess.run(["npm", ...]) does not resolve those shims, so it raises FileNotFoundError, have_npm() returns False, and every extraction prints:
Warning: A working NPM installation was not found. The package will use Python-based article extraction.
Warning: node executable not found, reverting to pure-Python mode. Install Node.js v10 or newer to use Readability.js.
The same resolution problem applies to subprocess.run(["npm", "install"], ...) in run_npm_install().
Suggested fix
Resolve the executable first with shutil.which("npm") - it returns the npm.cmd path on Windows and the plain npm path elsewhere - and invoke the resolved path in both have_npm() and run_npm_install().
Impact
Every Windows user silently gets the pure-Python extractor. In particular, mcp-server-fetch (modelcontextprotocol/servers) documents that installing Node.js makes it "use a different HTML simplifier that is more robust" - on Windows that never actually happens.
Activity