Last modified: Jul 21, 2025 By Alexander Williams

Install Puppeteer in Node.js - Quick Guide

Puppeteer is a powerful Node.js library for browser automation. It allows you to control Chrome or Chromium programmatically. This guide will help you install Puppeteer quickly.

Prerequisites

Before installing Puppeteer, ensure you have Node.js and npm installed. You can check by running:


node -v
npm -v

If not installed, download Node.js from the official website. It includes npm by default.

Install Puppeteer

To install Puppeteer, open your terminal and navigate to your project directory. Then run:


npm install puppeteer

This will download Puppeteer and its required Chromium browser. The installation may take a few minutes.

Verify Installation

Create a test file named test.js with this code:


const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  await page.goto('https://example.com');
  await browser.close();
})();

Run the script with:


node test.js

If no errors appear, Puppeteer is installed correctly.

Common Issues

Some systems may face permission issues. If so, try installing Puppeteer globally:


npm install -g puppeteer

For other Node.js module installations, check our guides on installing ts-jest or installing TypeScript.

Puppeteer Core

For a lighter version without Chromium, install puppeteer-core:


npm install puppeteer-core

This requires manually connecting to a browser instance.

Conclusion

Installing Puppeteer in Node.js is straightforward. With just one npm command, you get a powerful browser automation tool. For more Node.js guides, see our tutorial on installing Prettier.

Now you're ready to automate browser tasks with Puppeteer. Happy coding!