question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

npm ERR! Invalid name: "playwright@latest" when running "Install Playwright" from VSCode Command

See original GitHub issue

I wanted to try Playwright out. Haven’t previously had it installed anywhere. Created a new folder for it in VSCode and installed the Playwright Extension v0.2.8

Opened up the command palette and ran “Test: Install Playwright” Selected all browsers and included GitHub actions too.

Terminal output showing error is as follows

C:\...\MS Playwright Testing Utility> npm init --yes playwright@latest -- --quiet --browser=chromium --browser=firefox --browser=webkit --gha
npx: installed 1 in 1.798s
Getting started with writing end-to-end tests with Playwright:
Initializing project in 'playwright@latest'
Initializing NPM project (npm init -y)…    
npm ERR! Invalid name: "playwright@latest"

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\bwesl\AppData\Roaming\npm-cache\_logs\2022-08-17T03_29_03_729Z-debug.log
{ Error: Command failed: npm init -y
    at checkExecSyncError (child_process.js:611:11)
    at execSync (child_process.js:648:13)
    at executeCommands (C:\Users\bwesl\AppData\Roaming\npm-cache\_npx\23664\node_modules\create-playwright\lib\index.js:4519:39)
    at Generator.run (C:\Users\bwesl\AppData\Roaming\npm-cache\_npx\23664\node_modules\create-playwright\lib\index.js:4592:5)   
    at process._tickCallback (internal/process/next_tick.js:68:7)
    at Function.Module.runMain (internal/modules/cjs/loader.js:745:11)
    at startup (internal/bootstrap/node.js:279:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:752:3)
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 9228,
  stdout: null,
  stderr: null }

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
mxschmittcommented, Aug 17, 2022

We have a fix to make it work on NPM 6, so lets keep it open until its merged!

0reactions
AlexKomanovcommented, Aug 17, 2022

Thanks @BW-PA @mxschmitt

Read more comments on GitHub >

github_iconTop Results From Across the Web

[BUG] The installation with the "Install Playwright" command ...
npm ERR ! Invalid name: "playwright@latest" when running "Install Playwright" from VSCode Command microsoft/playwright-vscode#220.
Read more >
playwright - npm
Installation. Playwright has its own test runner for end-to-end tests, we call it Playwright Test. Using init command.
Read more >
Installing playwright using npm gives error `command failed`
json file and try running the command again. There are two other ways you can install Playwright.
Read more >
Playwright Framework: Tutorial on Getting Started
How to Install and run Playwright Test Script · Click on Sign In · Enter wrong credentials · Verify Error Message is displayed...
Read more >
Testing modern web apps with Playwright and VS Code
Playwright is a framework for building end-to-end tests for modern web applications. It can help us create tests that are resilient and run...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found