Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minutePC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
If Puppeteer throws ENOENT while saving a screenshot, check the destination path’s parent folders. A relative path is resolved from Node.js’s current working directory, and Puppeteer’s screenshot documentation does not say it creates missing directories. Create the parent folder before calling page.screenshot(), then log the resolved destination to confirm where the file will go. Puppeteer’s ScreenshotOptions documentation describes the path behavior; Node.js filesystem documentation explains ENOENT for paths that do not exist.
Why Puppeteer screenshot paths produce ENOENT
Puppeteer’s screenshot path names the file to save, and its format is inferred from the filename extension. When that path is relative, Puppeteer resolves it against process.cwd()—the process’s current working directory, not automatically the directory containing your JavaScript file. If any parent directory in the destination is missing, the filesystem operation can fail with ENOENT.
For example, screenshots/run/page.png requires both screenshots and screenshots/run to exist beneath the process working directory. Puppeteer’s screenshot guide shows saving a page or element screenshot with page.screenshot(), but does not document automatic creation of missing parent folders. If you omit path, Puppeteer does not save the screenshot to disk.
The cited API documentation surfaced as Puppeteer version 25.12.0, and the filesystem documentation as Node.js v26.10.0; those are documentation versions, not a statement about the versions installed in your project.
#1 Best Overall
- Get NVMe solid state performance with up to 1050MB/s read and 1000MB/s write speeds in a portable, high-capacity drive(1) (Based on internal testing; performance may be lower depending on host device & other factors. 1MB=1,000,000 bytes.)
- Up to 3-meter drop protection and IP65 water and dust resistance mean this tough drive can take a beating(3) (Previously rated for 2-meter drop protection and IP55 rating. Now qualified for the higher, stated specs.)
- Use the handy carabiner loop to secure it to your belt loop or backpack for extra peace of mind.
- Help keep private content private with the included password protection featuring 256‐bit AES hardware encryption.(3)
- Easily manage files and automatically free up space with the SanDisk Memory Zone app.(5). Non-Operating Temperature -20°C to 85°C
Fix the output directory before capturing
- Check the process working directory. Print
process.cwd()so you know the base used for relative screenshot paths. - Resolve and inspect the destination. Log the full path and check its spelling, capitalization, separators, and intended project or deployment location.
- Create the parent directory. Use Node.js’s promise-based
mkdir()with{ recursive: true }before saving. - Capture to the resolved path. Pass the absolute path to
page.screenshot(). - If ENOENT persists, inspect the error. Check the full
error.pathand runtime environment to see which absolute location the failing operation attempted to use.
Runnable example
This ES module pattern creates screenshots under the process working directory, then saves the page image there. It assumes page is an already-created Puppeteer page.
import { mkdir } from 'node:fs/promises';
import { dirname, resolve } from 'node:path';
const outputPath = resolve(process.cwd(), 'screenshots', 'page.png');
console.log('Working directory:', process.cwd());
console.log('Screenshot destination:', outputPath);
await mkdir(dirname(outputPath), { recursive: true });
await page.screenshot({ path: outputPath });
Choose a predictable path strategy
| Approach | How it works | Trade-off |
|---|---|---|
| Fixed absolute path | Set a full destination path for a controlled deployment and create its parent folder. | The location is explicit and predictable there, but may need configuration for another machine, container, or deployment. |
| Relative path from a known working directory | Resolve a relative filename against an intentionally chosen base, such as process.cwd(), and create the parent folder. |
It can be portable when the base is controlled, but test runners and deployment environments may start the process from a different working directory than expected. |
Neither strategy is prescribed for every application. The important point is to make the base directory deliberate and ensure the parent exists before the screenshot write.
Rank #2
- Solid state performance with up to 800MB/s read speeds in a portable drive. (Based on internal testing; performance may be lower depending on host device, interface, usage conditions and other factors. 1MB=1,000,000 bytes.)
- Back up your content and memories on a storage solution that fits seamlessly into your mobile lifestyle.
- Take it with you on your adventures—up to two-meter drop protection means this durable drive can take a beating. (Based on internal testing.)
- Secure it to your belt loop or backpack for extra peace of mind thanks to the tough rubber hook.
- From Sandisk, a brand professional photographers trust to take on assignments.
Troubleshoot ENOENT if creating the directory did not fix it
- The logged path is not where you expected: compare it with
process.cwd(). A script’s file location and the process working directory are not necessarily the same. - A nested folder is missing: ensure
mkdir(dirname(outputPath), { recursive: true })runs before the screenshot call, and thatoutputPathis the same path passed to Puppeteer. - The path contains a typo or case mismatch: inspect each directory and filename segment, including capitalization and path separators.
- The error names a different path: use
error.pathto identify the location reported by Node.js, then investigate that location and the runtime environment. - You omitted the screenshot path: without
path, Puppeteer does not write an image file to disk. Provide a filename if disk output is what you want. - You suspect a browser launch problem: this symptom points to a path or filesystem issue to investigate. The cited documentation does not support changing browser-installation settings or disabling browser security options as a fix for ENOENT.
Or skip the browser setup
If your goal is simply to get a website screenshot, ScreenshotNeo provides a screenshot API. Make one GET request with the target URL; see the ScreenshotNeo API documentation for request options.
Recommended Free Tools
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
ScreenshotNeo removes cookie banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, and failed loads are never billed. Its MCP server lets AI agents take screenshots, and the Free plan includes 1,000 screenshots a month without a card; paid plans start at $5 for 3,000. Sign up for free.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Frequently Asked Questions
Does Puppeteer create a missing screenshot directory automatically?
Its screenshot documentation does not state that missing parent directories are created. Create them before saving.
Rank #3
- Easily store and access 2TB to content on the go with the Seagate Portable Drive, a USB external hard drive
- Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
- To get set up, connect the portable hard drive to a computer for automatic recognition no software required
- This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
- The available storage capacity may vary.
Is a relative screenshot path based on the JavaScript file’s directory?
No. Puppeteer resolves a relative screenshot path from the process current working directory.
Quick Recap
Best Value
- Easily store and access 5TB of content on the go with the Seagate portable drive, a USB external hard Drive
- Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
- To get set up, connect the portable hard drive to a computer for automatic recognition software required
- This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
- The available storage capacity may vary.
Rank #4
- NEARLY 2X FASTER THAN OUR PREVIOUS GENERATION(8) – move 1,000 high-res photos in under 60 seconds(6) with up to 2000MB/s transfer speeds(2).
- IP65 RATING AND UP TO 3M DROP PROTECTION(3) – protects against spills and drops.
- POCKET-SIZED – fits easily in pockets and small bags.
- SPACE TO OWN YOUR AI CONTENT – speed and capacity to download your high-res clips and photo edits.
- 256-BIT AES ENCRYPTION(4) – helps keep private files secure with password protection.
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.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →

