Skip to content

Npm install fails with node v16 #218

@hb20007

Description

@hb20007

I have markdown-pdf installed on node v15. I switched to node v16 on the same machine. I was able to download all other global packages I had on node v15 on v16 without any problems, however, node i -g markdown-pdf returned this error:

npm error code 1
npm error path C:\Users\X\AppData\Roaming\fnm\node-versions\v26.1.0\installation\node_modules\markdown-pdf\node_modules\phantomjs-prebuilt
npm error command failed
npm error command C:\WINDOWS\system32\cmd.exe /d /s /c node install.js
npm error PhantomJS not found on PATH
npm error Download already available at C:\Users\X\AppData\Local\Temp\phantomjs\phantomjs-2.1.1-windows.zip
npm error Verified checksum of previously downloaded file
npm error Extracting zip contents
npm error Install exited unexpectedly
npm error A complete log of this run can be found in: C:\Users\X\AppData\Local\npm-cache\_logs\2026-05-10T11_29_46_824Z-debug-0.log

The log reveals the stack trace:

692 verbose stack Error: command failed
692 verbose stack     at promiseSpawn (C:\Users\X\AppData\Roaming\fnm\node-versions\v26.1.0\installation\node_modules\npm\node_modules\@npmcli\promise-spawn\lib\index.js:22:22)
692 verbose stack     at spawnWithShell (C:\Users\X\AppData\Roaming\fnm\node-versions\v26.1.0\installation\node_modules\npm\node_modules\@npmcli\promise-spawn\lib\index.js:124:10)
692 verbose stack     at promiseSpawn (C:\Users\X\AppData\Roaming\fnm\node-versions\v26.1.0\installation\node_modules\npm\node_modules\@npmcli\promise-spawn\lib\index.js:12:12)
692 verbose stack     at runScriptPkg (C:\Users\X\AppData\Roaming\fnm\node-versions\v26.1.0\installation\node_modules\npm\node_modules\@npmcli\run-script\lib\run-script-pkg.js:79:13)
692 verbose stack     at runScript (C:\Users\X\AppData\Roaming\fnm\node-versions\v26.1.0\installation\node_modules\npm\node_modules\@npmcli\run-script\lib\run-script.js:9:12)
692 verbose stack     at C:\Users\X\AppData\Roaming\fnm\node-versions\v26.1.0\installation\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\rebuild.js:328:17
692 verbose stack     at run (C:\Users\X\AppData\Roaming\fnm\node-versions\v26.1.0\installation\node_modules\npm\node_modules\promise-call-limit\dist\commonjs\index.js:67:22)
692 verbose stack     at C:\Users\X\AppData\Roaming\fnm\node-versions\v26.1.0\installation\node_modules\npm\node_modules\promise-call-limit\dist\commonjs\index.js:84:9
692 verbose stack     at new Promise (<anonymous>)
692 verbose stack     at callLimit (C:\Users\X\AppData\Roaming\fnm\node-versions\v26.1.0\installation\node_modules\npm\node_modules\promise-call-limit\dist\commonjs\index.js:35:69)
693 verbose pkgid phantomjs-prebuilt@2.1.16

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions