Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

Start by checking whether the Node process can find and launch the PhantomJS executable: node-horseman is a wrapper, not the browser binary. If installation failed, diagnose the exact error before changing permissions or download settings. If the executable launches but page capture fails, investigate the PhantomJS version and its network or TLS behavior separately. The PhantomJS project README says development was suspended and phantomjs-prebuilt is deprecated, so repairs are best treated as legacy maintenance rather than a long-term compatibility fix.

First identify which part is failing

A Horseman screenshot flow depends on two separate things: Horseman must start a PhantomJS executable, and that browser process must then load the target page. An error during executable discovery or launch is different from a timeout or network failure after launch. Fixing the wrong layer can waste time—for example, increasing a page-wait timeout cannot make a missing executable appear.

The node-horseman package documentation describes three ways to make PhantomJS available: put it on the process PATH, install a compatible PhantomJS package such as phantomjs-prebuilt or phantomjs, or provide its location through Horseman’s phantomPath option.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Record the complete error and determine whether it occurs during npm installation, when Horseman starts, or after a page load begins.
  2. Check the executable location and version in the same environment that runs the application.
  3. Apply the fix for that failure class; then rerun the smallest reproduction that exercises the failing stage.

Check executable discovery and Horseman configuration

Verify what the Node process can see

An interactive terminal, an IDE, a service manager and a CI runner can each provide different environment variables. A shell command that works in your terminal does not prove the Horseman process has the same PATH. Check from the environment that actually launches Node:

# macOS or Linux: locate the executable visible to this shell
command -v phantomjs

# Windows Command Prompt
where phantomjs

# In Node.js: inspect the PATH inherited by the application
node -e "console.log(process.env.PATH)"

If the executable cannot be located, install or expose the intended binary in that runtime environment. If it is available only at a known absolute location, pass that location as phantomPath when constructing Horseman. Use the actual resolved path for the machine or container; do not assume a path from a developer laptop also exists in production.

const Horseman = require('node-horseman');

const horseman = new Horseman({
  phantomPath: '/absolute/path/to/phantomjs'
});

The path above is an example location, not a real installation path. Replace it with the path reported by your own environment. Keep the option in the Horseman constructor/configuration used by your application, and verify the account that runs Node can execute that file.

Check the binary and duplicate installations

Run phantomjs --version in the same runtime environment. The PhantomJS troubleshooting guide recommends checking the version and whether multiple installations exist when behavior is unexpected. If more than one binary is installed, compare the command’s resolved location with the path Horseman receives; otherwise you may inspect one installation while the application launches another.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Sale
HTML and CSS: Design and Build Websites
  • HTML CSS Design and Build Web Sites
  • Comes with secure packaging
  • It can be a gift option

Do not confuse launch timeouts with page-wait timeouts

The Horseman package documentation lists a default timeout of 5,000 ms and a polling interval of 50 ms. These settings relate to waiting behavior; increasing a wait does not repair a missing, non-executable or incompatible PhantomJS binary. First confirm that PhantomJS starts. Only investigate wait settings after launch succeeds and the failure occurs while waiting for page behavior.

Fix npm installation errors by their exact message

The installer has its own prerequisites and download path. The phantomjs npm documentation associates several common messages with distinct causes. Start by identifying which one matches your log rather than applying all of the fixes below.

Error or symptom Likely failure class What to check or change
spawn ENOENT The installer cannot find a required command; the documentation cites node or tar missing from PATH or incorrectly installed. Check that each required command is installed and visible in the environment running npm. If npm runs in CI, a container, or an IDE, check that environment rather than only your login shell.
EPERM, EACCES, or “permission denied” The install process cannot write to a directory, cache, or target file, or software is blocking filesystem writes. Inspect write access and ownership for the specific install directory and npm cache. Correct the affected permissions or remove the blocking condition; do not assume a new remote download will fix a local write failure.
read ECONNRESET or connect ETIMEDOUT The download connection was interrupted or did not complete. Check connectivity from the machine running npm, along with proxy rules, firewall restrictions and access to the configured download host. Retry only after confirming the network path is available.

Use a custom download mirror carefully

The installer documentation describes setting a mirror through phantomjs_cdnurl or the PHANTOMJS_CDNURL environment variable. This is useful only if the chosen mirror is reachable and serves the expected binary. Because the package is deprecated, verify that the endpoint is currently available before depending on an old mirror instruction. Do not substitute an unverified mirror URL into a build configuration.

Check the target platform in cross-platform builds

The installer documentation discusses platform-specific binaries and rebuilding dependencies for cross-platform workflows. Avoid carrying a locally installed binary or dependency directory from one operating system or architecture into a different target and assuming it will work. Install or rebuild dependencies in an environment appropriate to the target platform, and make the build/runtime platform explicit in CI.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If PhantomJS launches but pages still fail

Once Horseman can start the executable, investigate browser behavior as a separate problem. Confirm the launched binary’s version and path, then narrow the issue to the page, network path or environment.

HTTPS or TLS failures

The PhantomJS troubleshooting guide identifies TLS/OpenSSL dependencies and configuration as leads for HTTPS-only problems. Compare an HTTPS page with a page that loads successfully, inspect the runtime’s TLS-related error output, and test the relevant dependency/configuration in the same environment. These are legacy troubleshooting leads, not a universal switch that resolves every HTTPS failure.

Rank #4
Sale
Web Design with HTML, CSS, JavaScript and jQuery Set
  • Brand: Wiley
  • Set of 2 Volumes
  • A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers

Proxy-specific failures

If a page works without the proxy but fails through it, isolate the proxy path as the variable. The troubleshooting guide describes launching without the proxy as a diagnostic step. Use that only to establish whether the proxy is involved; it does not establish that permanently bypassing the proxy is safe or appropriate for your network.

Timeouts and failed page loads

Separate an executable startup failure from a page that is slow, blocked or unreachable. Capture the exact failure stage and test the target URL from the same network context. If only certain pages fail, compare their network, HTTPS and proxy requirements rather than changing Horseman’s executable path without evidence.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

When to repair the legacy stack—and when to replace it

The official PhantomJS README states: “This repository and NPM package are now deprecated since PhantomJS development had been suspended.” A PATH correction, permission repair or verified mirror may restore an existing build, but it does not create future upstream fixes for new platform or browser-behavior problems.

For a pinned application, first decide whether the immediate goal is to reproduce an existing environment or to maintain the feature over time. If you evaluate a replacement, compare candidates against the application’s actual needs rather than assuming there is a drop-in migration target:

  • Which browser features and page behaviors does the workflow depend on?
  • Does the candidate install and run on the Node version, operating systems and architectures used in development and CI?
  • Can its network, TLS, proxy and authentication behavior be tested in the target runtime?
  • How much code and operational configuration must change?
  • Is the replacement actively maintained, and does its maintenance status fit the project’s support expectations?

The sources do not establish one universal successor to Horseman/PhantomJS. Test a candidate against the real pages, timing requirements and outputs your application uses before committing to migration.

Or skip the browser setup

If the job is to capture website screenshots or PDFs rather than to preserve a Horseman-specific automation workflow, ScreenshotNeo is a separate screenshot API option. One GET request can return a screenshot or PDF; it does not repair PhantomJS or act as a drop-in Horseman replacement.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Example cURL request (replace the URL as needed); see the ScreenshotNeo API documentation for options and response details:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

For this screenshot use case, ScreenshotNeo accepts cookie/consent banners before capture and removes more than 60 known consent platforms, newsletter popups and chat widgets; each of those steps can be turned off. Bot checks/CAPTCHAs, blank pages, timeouts, failed loads and cache hits are not billed, and response headers identify the page verdict and billing status. Its MCP server offers take_screenshot, get_page_info and capture_pdf tools for AI agents and MCP clients. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots.

Sign up for 1,000 free screenshots a month with no card.

Frequently Asked Questions

Does the node-horseman package version number prove it supports my current Node.js release?

No. The package listing identifies version 3.3.0 and shows historical publication metadata, but that alone does not establish compatibility with a particular current Node.js release or operating system. Verify the exact runtime in a clean environment before relying on it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.