playwright-community / playwright-go

Playwright for Go a browser automation library to control Chromium, Firefox and WebKit with a single API.
https://playwright-community.github.io/playwright-go/
MIT License
1.94k stars 145 forks source link

Installation failed for Apple M1 Pro - .addTestCommand is not a function, could not run driver #341

Closed august-at-statapile closed 3 months ago

august-at-statapile commented 1 year ago

Chip: Apple M1 Pro OS: Ventura 13.0 (22A380)

using go1.20.2 darwin/amd64

npm version 9.5.1 (if it helps)

go run github.com/playwright-community/playwright-go/cmd/playwright install --with-deps returns

2023/04/06 09:29:55 Downloaded driver successfully
/Users/[redacted]/Library/Caches/ms-playwright-go/1.20.0-beta-1647057403000/package/lib/cli/cli.js:263
    require(playwrightTestPackagePath).addTestCommand(_commander.program);
                                       ^
TypeError: require(...).addTestCommand is not a function
    at Object.<anonymous> (/Users/[redacted]/Library/Caches/ms-playwright-go/1.20.0-beta-1647057403000/package/lib/cli/cli.js:263:40)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:17:47
2023/04/06 09:29:58 could not run driver: exit status 1
exit status 1

Any ideas? Thank you in advance!

2113vm commented 1 year ago

Have the same troubles. Any news?

mkc-bill commented 1 year ago

same error , mac M2

canstand commented 1 year ago

Pls try add @latest to ensure the latest version is used:

go run github.com/playwright-community/playwright-go/cmd/playwright@latest install --with-deps