appium / appium-windows-driver

Appium's interface to WindowsAppDriver provided by Microsoft
Apache License 2.0
133 stars 35 forks source link

Error loading driver with nodejs version 21+ #242

Closed yeDor closed 9 months ago

yeDor commented 9 months ago

having node --version v21.6.2

appium
[Appium] Welcome to Appium v2.5.1
[Appium] The autodetected Appium home path: C:\Users\Yevgen\.appium
[Appium] Attempting to load driver windows...
[Appium] Requiring driver at C:\Users\Yevgen\.appium\node_modules\appium-windows-driver\build\index.js
[Appium] Could not load driver 'windows', so it will not be available. Error in loading the driver was: Unexpected External value as type specifier, expected string or type
[Appium] TypeError: Unexpected External value as type specifier, expected string or type
[Appium]     at Object.<anonymous> (C:\Users\Yevgen\.appium\node_modules\appium-windows-driver\lib\commands\winapi\user32.js:102:49)
[Appium]     at Module._compile (node:internal/modules/cjs/loader:1378:14)
[Appium]     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1437:10)
[Appium]     at Module.load (node:internal/modules/cjs/loader:1212:32)
[Appium]     at Function.Module._load (node:internal/modules/cjs/loader:1028:12)
[Appium]     at Module.require (node:internal/modules/cjs/loader:1237:19)
[Appium]     at require (node:internal/modules/helpers:176:18)
[Appium]     at Object.<anonymous> (C:\Users\Yevgen\.appium\node_modules\appium-windows-driver\lib\commands\gestures.js:2:1)
[Appium]     at Module._compile (node:internal/modules/cjs/loader:1378:14)
[Appium]     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1437:10)
[Appium]     at Module.load (node:internal/modules/cjs/loader:1212:32)
[Appium]     at Function.Module._load (node:internal/modules/cjs/loader:1028:12)
[Appium]     at Module.require (node:internal/modules/cjs/loader:1237:19)
[Appium]     at require (node:internal/modules/helpers:176:18)
[Appium]     at Object.<anonymous> (C:\Users\Yevgen\.appium\node_modules\appium-windows-driver\lib\commands\index.js:9:1)
[Appium]     at Module._compile (node:internal/modules/cjs/loader:1378:14)
[Appium]     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1437:10)
[Appium]     at Module.load (node:internal/modules/cjs/loader:1212:32)
[Appium]     at Function.Module._load (node:internal/modules/cjs/loader:1028:12)
[Appium]     at Module.require (node:internal/modules/cjs/loader:1237:19)
[Appium]     at require (node:internal/modules/helpers:176:18)
[Appium]     at Object.<anonymous> (C:\Users\Yevgen\.appium\node_modules\appium-windows-driver\lib\driver.js:6:1)
[Appium] Appium REST http interface listener started on http://0.0.0.0:4723
[Appium] You can provide the following URLs in your client code to connect to this server:
[Appium]        http://10.245.2.10:4723/
[Appium]        http://172.17.16.1:4723/
[Appium]        http://172.21.80.1:4723/
[Appium]        http://192.168.128.82:4723/
[Appium]        http://127.0.0.1:4723/ (only accessible from the same host)
[Appium]        http://172.31.64.1:4723/
[Appium] Available drivers:
[Appium]   - windows@2.12.16 (automationName 'Windows')
[Appium] Available plugins:
[Appium]   - appium-reporter-plugin@1.1.0-beta.06
[Appium] No plugins activated. Use the --use-plugins flag with names of plugins to activate

if downgraded to nodejs v20.11.1, all works fine

KazuCocoa commented 9 months ago

Yes, we recommend LTS node versions. it is probably type related issue in latest edge nodejs version. https://github.com/appium/appium/issues/19659