由于无法识别参数,无法在 Windows 上安装 playwright

new*_*eff 2 windows powershell playwright

我已在 Windows 上验证我已安装 Powershell - 最新版本。

当我从 Playwright 网站运行命令时:

pwsh bin/Debug/netX/playwright.ps1 install

我收到以下错误:“argument bin/Debug/netX/playwright.ps1”未被识别为脚本文件的名称。我一直无法找到解决办法。*

*添加更多错误

Md.*_*her 6

现有的 GitHub 问题与此问题有关。总结此处列出的解决方案,您可以尝试以下一些操作:

安装PowerShell工具:

dotnet tool install --global PowerShell
Run Code Online (Sandbox Code Playgroud)

或者,更新 PowerShell 工具:

dotnet tool update --global PowerShell
Run Code Online (Sandbox Code Playgroud)

或者,从 Microsoft 网站安装PowerShell Core

然后,您可以尝试安装 playwright CLI 和浏览器。

dotnet tool install --global Microsoft.Playwright.CLI
playwright install
Run Code Online (Sandbox Code Playgroud)

如果这些都不能解决您的问题,请在评论中分享。