webdriverio: [๐Ÿ› Bug]: Error thrown right away when running "yarn create wdio ."

Have you read the Contributing Guidelines on issues?

WebdriverIO Version

8.17.0 and 8.17.1

Node.js Version

18.17.1 and 20.8.0

Mode

WDIO Testrunner

Which capabilities are you using?

I didn't even get to configure/use capabilities

What happened?

As soon as I run the command yarn create wdio . I get an error. I tried on 2 different linux laptops, and 2 different node version (18 and 20), it happened both on WDIO 8.17.0 and 8.17.1

What is your expected behavior?

Base framework creation should succeed unless thereโ€™s other issues (like network or disk problems)

How to reproduce the bug.

Just run yarn create wdio .

Relevant log output

Installing @wdio/cli to initialize project...
โœ” Success!
node:internal/modules/cjs/loader:1048
  const err = new Error(message);
              ^

Error: Cannot find module 'call-bind'
Require stack:
- /home/gr4ce/workspace/personal/webdriver.io/versions-test/tmp/node_modules/@ljharb/through/index.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1048:15)
    at Module._load (node:internal/modules/cjs/loader:901:27)
    at Module.require (node:internal/modules/cjs/loader:1115:19)
    at require (node:internal/modules/helpers:130:18)
    at Object.<anonymous> (/home/gr4ce/workspace/personal/webdriver.io/versions-test/tmp/node_modules/@ljharb/through/index.js:4:16)
    at Module._compile (node:internal/modules/cjs/loader:1241:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
    at Module.load (node:internal/modules/cjs/loader:1091:32)
    at Module._load (node:internal/modules/cjs/loader:938:12)
    at cjsLoader (node:internal/modules/esm/translators:284:17)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:234:7)
    at ModuleJob.run (node:internal/modules/esm/module_job:217:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)
    at async file:///home/gr4ce/workspace/personal/webdriver.io/versions-test/tmp/node_modules/@wdio/cli/bin/wdio.js:15:17 {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/gr4ce/workspace/personal/webdriver.io/versions-test/tmp/node_modules/@ljharb/through/index.js'
  ]
}

Node.js v20.8.0


โš ๏ธ  Ups, something went wrong: Error calling: npx wdio config!
error Command failed.
Exit code: 1
Command: /home/gr4ce/.yarn/bin/create-wdio
Arguments: .
Directory: /home/gr4ce/workspace/personal/webdriver.io/versions-test/tmp
Output:

info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.

Code of Conduct

  • I agree to follow this projectโ€™s Code of Conduct

Is there an existing issue for this?

  • I have searched the existing issues

About this issue

  • Original URL
  • State: closed
  • Created 9 months ago
  • Reactions: 3
  • Comments: 16 (10 by maintainers)

Most upvoted comments

@giuseppe-salvatore we do have plans to add some smoke tests in the future for some cli setups ๐Ÿ‘

Closing then, thanks for confirming!

If anyone still encounters this, please comment below.

@jan-molak ๐Ÿ‘ thanks for mentioning that, I suspected from the logs it could be a nested dependency issue but didnโ€™t have the time to investigate further

It is also not only the Python dependency โ€ฆ I would personally just prefer a Node.js based tool since I donโ€™t want contributor to have to context switch and understand Python code. I am sure this kind of stuff is also possible with Node.js.

We had an issue open for this in https://github.com/webdriverio/webdriverio/issues/5672 but I closed it because it seems very difficult to do and no one picked it up. It would be awesome to have a test similar to what you have. I would prefer to have it use a Node.js tool for this so we donโ€™t need to add Python as a dev dependency.

Creating a new project from scratch works for me, can anyone confirm?

Yeah, all good here too ๐Ÿ‘

Creating a new project from scratch works for me, can anyone confirm?

I guess there is nothing we can do aside from waiting for the dependency to be fixed.

Not necessarily, we could add an explicit dependency on @ljharb/through@2.3.9 in @wdio/cli. Since inquirer uses a dependency range, such override would fix it.

I guess there is nothing we can do aside from waiting for the dependency to be fixed.

This is caused by a missing dependency on call-bind - a bug introduced in @ljharb/through version 2.3.10 and reported at https://github.com/ljharb/through/issues/1

@ljharb/through is a dependency of inquirer (see https://github.com/SBoudrias/Inquirer.js/issues/1317), which WebdriverIO relies on.

To work around it, install @ljharb/through@2.3.9 in your Node project and re-run WebdriverIO:

npm install --save-dev @ljharb/through@2.3.9

I have the same error but for Windows 10 and when npm init wdio .