Skip to content

Commit 4e86d39

Browse files
docs: recommend a dev install of Playwright in the docs. (#2355)
1 parent d532cd5 commit 4e86d39

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Headless execution is supported for all the browsers on all platforms.
1717
## Usage
1818

1919
```
20-
npm i playwright
20+
npm i -D playwright
2121
```
2222

2323
This installs Playwright and browser binaries for Chromium, Firefox and WebKit. Once installed, you can `require` Playwright in a Node.js script and automate web browser interactions.

docs/api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4393,7 +4393,7 @@ If Playwright doesn't find them in the environment, a lowercased variant of thes
43934393

43944394
```sh
43954395
# Install browsers to the shared location.
4396-
$ PLAYWRIGHT_BROWSERS_PATH=$HOME/playwright-browsers npm install playwright
4396+
$ PLAYWRIGHT_BROWSERS_PATH=$HOME/playwright-browsers npm install --save-dev playwright
43974397
# Use shared location to find browsers.
43984398
$ PLAYWRIGHT_BROWSERS_PATH=$HOME/playwright-browsers node playwright-script.js
43994399
```

docs/installation.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Each version of Playwright needs specific versions of browser binaries to operat
1818
- `~/.cache/ms-playwright` on Linux
1919

2020
```sh
21-
npm i playwright
21+
npm i -D playwright
2222
```
2323

2424
These browsers will take few hundreds of megabytes of the disk space when installed:
@@ -33,7 +33,7 @@ du -hs ./Library/Caches/ms-playwright/*
3333
You can override default behavior using environment variables. When installing Playwright, ask it to download browsers into a specific location:
3434

3535
```sh
36-
$ PLAYWRIGHT_BROWSERS_PATH=$HOME/pw-browsers npm i playwright
36+
$ PLAYWRIGHT_BROWSERS_PATH=$HOME/pw-browsers npm i -D playwright
3737
```
3838

3939
When running Playwright scripts, ask it to search for browsers in a shared location:
@@ -65,7 +65,7 @@ binaries. In this case, Playwright can be configured to download from a custom
6565
location using the `PLAYWRIGHT_DOWNLOAD_HOST` env variable.
6666

6767
```sh
68-
$ PLAYWRIGHT_DOWNLOAD_HOST=192.168.1.78 npm i playwright
68+
$ PLAYWRIGHT_DOWNLOAD_HOST=192.168.1.78 npm i -D playwright
6969
```
7070

7171
<br>
@@ -78,7 +78,7 @@ browser binaries are managed separately.
7878
This can be done by setting `PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD` variable before installation.
7979

8080
```sh
81-
$ PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm i playwright
81+
$ PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm i -D playwright
8282
```
8383

8484
<br>
@@ -97,7 +97,7 @@ Using these packages is as easy as using a regular Playwright:
9797
Install a specific package
9898

9999
```sh
100-
$ npm i playwright-webkit
100+
$ npm i -D playwright-webkit
101101
```
102102

103103
Require package

docs/intro.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
Use npm or Yarn to install Playwright in your Node.js project. Playwright requires Node.js 10 or higher.
1616

1717
```sh
18-
npm i playwright
18+
npm i -D playwright
1919
```
2020

2121
During installation, Playwright downloads browser binaries for Chromium, Firefox and WebKit. This sets up your environment for browser automation with just one command. It is possible to modify this default behavior for monorepos and other scenarios. See [installation parameters](installation.md) for mode details.

0 commit comments

Comments
 (0)