Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[🐛 Bug]: Installing dependencies via Yarn fails when using Yarn workspaces #8144

Closed
3 tasks done
christian-bromann opened this issue Mar 22, 2022 · 4 comments · Fixed by #8172
Closed
3 tasks done
Labels
Bug 🐛 good first pick a reasonable task to start getting familiar with the code base help wanted Issues that are free to take by anyone interested

Comments

@christian-bromann
Copy link
Member

Have you read the Contributing Guidelines on issues?

WebdriverIO Version

latest

Node.js Version

latest

Mode

WDIO Testrunner

Which capabilities are you using?

n/a

What happened?

When creating a project from scratch in an existing project that uses Yarn workspaces the wdio config command fails installing the dependencies because of a missing -W, e.g.:

Installing wdio packages:
- @wdio/local-runner
- @wdio/mocha-framework
- @wdio/spec-reporter
- wdio-vscode-service
yarn add v1.22.17
error Running this command will add the dependency to the workspace root rather than the workspace itself, which might not be what you want - if you really meant it, make it explicit by running this command again with the -W flag (or --ignore-workspace-root-check).
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
An unknown error happened! Please retry installing dependencies via "yarn add --dev @wdio/local-runner @wdio/mocha-framework @wdio/spec-reporter wdio-vscode-service"

Error: unknown
/Users/christianbromann/.config/yarn/global/node_modules/create-wdio/build/utils.js:21
                return reject(new Error((error && error.message) ||
                              ^

Error: Error calling: npx wdio config
    at ChildProcess.<anonymous> (/Users/christianbromann/.config/yarn/global/node_modules/create-wdio/build/utils.js:21:31)
    at ChildProcess.emit (node:events:390:28)
    at maybeClose (node:internal/child_process:1064:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
error Command failed.
Exit code: 1
Command: /Users/christianbromann/.yarn/bin/create-wdio
Arguments: .
Directory: /Users/christianbromann/Sites/Stateful/projects/vscode-marquee
Output:

info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.
❯ "yarn add --dev @wdio/local-runner @wdio/mocha-framework @wdio/spec-reporter wdio-vscode-service
❯ yarn add --dev @wdio/local-runner @wdio/mocha-framework @wdio/spec-reporter wdio-vscode-service
yarn add v1.22.17
error Running this command will add the dependency to the workspace root rather than the workspace itself, which might not be what you want - if you really meant it, make it explicit by running this command again with the -W flag (or --ignore-workspace-root-check).
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

What is your expected behavior?

We should check within the package.json if workspaces are being used and either add a -W to the install statement or ask the user whether to add it to one of the sub-packages.

How to reproduce the bug.

Create a project that uses Yarn workspaces and try to run the WDIO wizard on it.

Relevant log output

see above

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
@christian-bromann christian-bromann added Bug 🐛 help wanted Issues that are free to take by anyone interested good first pick a reasonable task to start getting familiar with the code base labels Mar 22, 2022
@cschar
Copy link

cschar commented Mar 30, 2022

I got a similar error right now:

command run npx wdio . --yes

Documentation: https://webdriver.io
@wdio/cli (v7.19.2)

TypeError: answers.plugins.map is not a function
    at runConfig (/Users/user1/electron-test/node_modules/@wdio/cli/build/commands/config.js:43:44)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
/Users/user1/.npm/_npx/471611576716610c/node_modules/wdio/build/utils.js:21
                return reject(new Error((error && error.message) ||
                              ^

Error: Error calling: npx wdio config --yes

@christian-bromann
Copy link
Member Author

I believe the plugins property in our questionnaire object needs a default value as empty array.

@cschar wanna help us take a stab at this?

@Angela0508
Copy link

Angela0508 commented Jul 12, 2023

I got an error
command run yarn add wdio

[4/4] Building fresh packages...
[7/7] ⠂ fibers
[-/7] ⠂ waiting...
[3/7] ⠂ fibers
[-/7] ⠄ waiting...
error C:\selenium-testsuite\node_modules\wdio-sync\node_modules\fibers: Command failed.
Exit code: 1
Command: node build.js || nodejs build.js
Arguments:
Directory: C:\selenium-testsuite\node_modules\wdio-sync\node_modules\fibers
Output:

@christian-bromann
Copy link
Member Author

@Angela0508 hey 👋 it seems you are trying to install an old WebdriverIO version that comes with fibers which we don't support anymore. I recommend updating you WebdriverIO version to latest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🐛 good first pick a reasonable task to start getting familiar with the code base help wanted Issues that are free to take by anyone interested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants