angular / webdriver-manager

A binary manager for E2E testing
MIT License
224 stars 116 forks source link

webdriver-manager downloads mac64_m1 on x86_64 arch #476

Open ciekawy opened 3 years ago

ciekawy commented 3 years ago

I think m1 builds are new and for some reason webdriver-manager sticks to m1 even on intel

I/downloader - curl -o/Users/szymon/git/toptal/plan-simply/node_modules/webdriver-manager/selenium/chromedriver_87.0.4280.88.zip https://chromedriver.storage.googleapis.com/87.0.4280.88/chromedriver_mac64_m1.zip
ciekawy commented 3 years ago

As I badly needed to get unblocked - here is a hacky workaround for anyone in similar situation (only for x86_64 macOS). In node_modules/webdriver-manager/built/lib/files/file_manager.js update fileUrl.url around 166:

fileUrl.url = fileUrl.url.replace(/_m1/, '');

I did quick investigation yet it was not clear to me what the fixing PR should look like.

pawelusfr commented 3 years ago

@cnishina If I understand the code correctly we need a fix somewhere here https://github.com/angular/webdriver-manager/blob/legacy/lib/binaries/chrome_xml.ts#L37 I don't know what's the osarch reported for m1 CPUs but the problem is that both m1 and x84_64 versions of chromedriver have mac64 in the name so we need to remove the ones that have m1 in the name for x84_64 and for m1 we'd have to remove the ones that don't have m1 in the name

jamesg1 commented 3 years ago

@ciekawy Thanks for your fix got tests working again on mac for development.

furnace915 commented 3 years ago

@ciekawy thank you for the suggestion...seems to work

cnishina commented 3 years ago

Hi everyone. We'll have a fix this weekend.

cnishina commented 3 years ago

This has been published 12.1.8. After updating to version 12.1.8, you will need to run webdriver-manager clean before running webdriver-manager update

cnishina commented 3 years ago

Leaving this issue open for users running into this problem.

snover80 commented 3 years ago

Hey There!

I'm still getting the issue I have tried a while ago but I keep getting the error. Am I doing something wrong? I'm doing it directly from my VS Code console. Here's my log.

$ sudo webdriver-manager clean Password: [12:18:37] I/file_manager - removed chromedriver_87.0.4280.88 [12:18:37] I/file_manager - removed chromedriver_87.0.4280.88.zip [12:18:37] I/file_manager - removed geckodriver-v0.28.0 [12:18:37] I/file_manager - removed geckodriver-v0.28.0.tar.gz [12:18:37] I/file_manager - removed selenium-server-standalone-3.141.59.jar [12:18:37] I/file_manager - removed chrome-response.xml [12:18:37] I/file_manager - removed gecko-response.json [12:18:37] I/file_manager - removed standalone-response.xml [12:18:37] I/file_manager - removed update-config.json

$ sudo webdriver-manager update [12:19:02] I/config_source - curl -o/usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/standalone-response.xml https://selenium-release.storage.googleapis.com/ [12:19:02] I/config_source - curl -o/usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/chrome-response.xml https://chromedriver.storage.googleapis.com/ [12:19:02] I/config_source - curl -o/usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/gecko-response.json https://api.github.com/repos/mozilla/geckodriver/releases [12:19:03] I/downloader - curl -o/usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-3.141.59.jar https://selenium-release.storage.googleapis.com/3.141/selenium-server-standalone-3.141.59.jar [12:19:03] I/downloader - curl -o/usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_87.0.4280.88.zip https://chromedriver.storage.googleapis.com/87.0.4280.88/chromedriver_mac64_m1.zip [12:19:04] I/downloader - curl -o/usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-v0.28.0.tar.gz https://github.com/mozilla/geckodriver/releases/download/v0.28.0/geckodriver-v0.28.0-macos.tar.gz [12:19:05] I/update - geckodriver: unzipping geckodriver-v0.28.0.tar.gz [12:19:05] I/update - geckodriver: setting permissions to 0755 for /usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-v0.28.0 [12:19:05] I/update - chromedriver: unzipping chromedriver_87.0.4280.88.zip [12:19:05] I/update - chromedriver: setting permissions to 0755 for /usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_87.0.4280.88

$ protractor conf.js [12:21:16] I/launcher - Running 1 instances of WebDriver [12:21:16] I/direct - Using ChromeDriver directly... [12:21:16] E/launcher - spawn Unknown system error -86 [12:21:16] E/launcher - Error: spawn Unknown system error -86 at ChildProcess.spawn (internal/child_process.js:371:11) at Object.spawn (child_process.js:561:9) at exec (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/io/exec.js:116:27) at resolveCommandLineFlags.then.args (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/remote/index.js:219:25) at processTicksAndRejections (internal/process/task_queues.js:86:5) From: Task: WebDriver.createSession() at Function.createSession (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver.js:769:24) at Function.createSession (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/chrome.js:761:15) at Direct.getNewDriver (/usr/local/lib/node_modules/protractor/built/driverProviders/direct.js:77:33) at Runner.createBrowser (/usr/local/lib/node_modules/protractor/built/runner.js:195:43) at q.then.then (/usr/local/lib/node_modules/protractor/built/runner.js:339:29) at _fulfilled (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:834:54) at /usr/local/lib/node_modules/protractor/node_modules/q/q.js:863:30 at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:796:13) at /usr/local/lib/node_modules/protractor/node_modules/q/q.js:556:49 at runSingle (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:137:13) [12:21:16] E/launcher - Process exited with error code 199

pawelusfr commented 3 years ago

@cnishina I confirm 12.1.8 works as expected. @snover80 you might want to force a dependency update on Protractor (e.g. by doing npm install --force protractor as you probably still have 12.1.7)

bobKasbi commented 3 years ago

The hint regarding protractor update via npm install --force protractor did the fix. Thanks

snover80 commented 3 years ago

Alright guys, not sure why npm install --force protractor didn't work for me (I mean, It kept downloading 12.1.7). I uninstall protractor globally (npm uninstall -g protractor) and install it again, then it worked. Thank you all.

cnishina commented 3 years ago

Alright guys, not sure why npm install --force protractor didn't work for me (I mean, It kept downloading 12.1.7). I uninstall protractor globally (npm uninstall -g protractor) and install it again, then it worked. Thank you all.

From the Angular discord channel, you could try to remove your node_modules directory and also your package lock json file. Then run npm cache verify to clean the cache then reinstall.

ciekawy commented 3 years ago

what I did for yarn in regard to update nested dependency I removed webdriver-manager from yarn.lock then re-run install. I guess it should work same when you remove webdriver-manager (main entry) from package-lock.json

ciekawy commented 3 years ago

False alert - found myself in a branch with outdated webdriver-manager

~for some reason I see now webdriver-manager downloading arm_64 version again...~

file ./node_modules/webdriver-manager/selenium/chromedriver_88.0.4324.96
./node_modules/webdriver-manager/selenium/chromedriver_88.0.4324.96: Mach-O 64-bit executable arm64
driiftkiing commented 3 years ago

Worked solutions for me:

Solution 1 Reinstall protractor:

yarn remove protractor; yarn add protractor --tilde --dev

Solution 2 Force version of a package without adding to dependency list and without reinstall package:

"resolutions": {
    "webdriver-manager": "^12.1.8"
}
theandrewlane commented 3 years ago

This worked for me:

  1. Remove the webdriver-manager entry from your yarn.lock
  2. Run yarn install --force

This should pull in webdriver-manager 12.1.8 and update your yarn.lock 😁

danday74 commented 3 years ago

npm install --save-dev webdriver-manager@12.1.8

This fixed the problem for me on its own with no other action

iamlevik commented 3 years ago

I think m1 builds are new and for some reason webdriver-manager sticks to m1 even on intel

I/downloader - curl -o/Users/szymon/git/toptal/plan-simply/node_modules/webdriver-manager/selenium/chromedriver_87.0.4280.88.zip https://chromedriver.storage.googleapis.com/87.0.4280.88/chromedriver_mac64_m1.zip

Hey, I'm having a M1 machine and my 'webdriver-manager' only downloads the 'intel' version. How did you manage to get around it? As I want to have the m1 based chromedriver. Thanks in advance.

szgabsz91 commented 3 years ago

@iamlevik, what version of webdriver-manager are you using? Here, the problem was the opposite, I think on an M1 mac it should definitely download the M1 version, although I have an Intel based machine. Doesn't an upgrade to the latest version solve your issue?

iamlevik commented 3 years ago

@iamlevik, what version of webdriver-manager are you using? Here, the problem was the opposite, I think on an M1 mac it should definitely download the M1 version, although I have an Intel based machine. Doesn't an upgrade to the latest version solve your issue?

Hey, just managed to solve it. It seemed that not installing correctly Homebrew (forgot to export the new paths) it forced installed node and webdriver-manager after that as Intel, as it was missing the required path for M1. Afterwards it worked instantly. Thanks for the quick reply!