windowspowershellplaywright

Unable to install playwright on a Windows due to not recognizing argument


I have verified on my windows that I have Powershell - the latest version installed.

When I run the command from the Playwright website :

pwsh bin/Debug/netX/playwright.ps1 install

I get the following error : 'argument bin/Debug/netX/playwright.ps1' is not recognized as the name of a script file. and I have been unable to find a work around. *

*to add more the error


Solution

  • There is an existing GitHub issue regarding this problem. To summarize the solutions listed there, here are a few things you can try:

    Install the PowerShell tool:

    dotnet tool install --global PowerShell
    

    Or, Update the PowerShell tool:

    dotnet tool update --global PowerShell
    

    Or, Install PowerShell Core from the Microsoft website

    Then, you can try to install playwright CLI and the browsers.

    dotnet tool install --global Microsoft.Playwright.CLI
    playwright install
    

    If none if these solves your problem, kindly share in the comments.