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

Error: Cannot find package 'vitest' imported from /node_modules/@vitest/coverage-v8/dist/provider.js #3822

Closed
6 tasks done
MERCMS opened this issue Jul 27, 2023 · 4 comments
Closed
6 tasks done

Comments

@MERCMS
Copy link

MERCMS commented Jul 27, 2023

Describe the bug

After attempting to migrate from coverage-c8 to coverage-v8, I get the above errror when running npm run test. As npm ls vitest shows, vitest is installed:

    abc-fe@0.0.1-SNAPSHOT /var/www/abc-fe
    └─┬ @abc-fe/shared@1.4.0-SNAPSHOT -> ./packages/shared
      └── vitest@0.33.0

Reproduction

Follow migration guide at #3339

System Info

System:
    OS: Linux 5.10 Ubuntu 20.04.6 LTS (Focal Fossa)
    CPU: (16) x64 11th Gen Intel(R) Core(TM) i7-11850H @ 2.50GHz
    Memory: 47.58 GB / 50.00 GB
    Container: Yes
    Shell: 5.0.17 - /bin/bash
  Binaries:
    Node: 16.19.0 - ~/.nvm/versions/node/v16.19.0/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v16.19.0/bin/yarn
    npm: 8.19.3 - ~/.nvm/versions/node/v16.19.0/bin/npm
    pnpm: 8.6.10 - ~/.nvm/versions/node/v16.19.0/bin/pnpm
  npmPackages:
    @vitejs/plugin-vue: 3.2.0 => 3.2.0
    vite: 3.2.4 => 3.2.4
    vitest: 0.33.0 => 0.33.0

Used Package Manager

npm

Validations

@github-actions
Copy link

Hello @MERCMS. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with need reproduction will be closed if they have no activity within 3 days.

@MERCMS
Copy link
Author

MERCMS commented Jul 27, 2023

Creating a reproduction on StackBlitz will be difficult to say the least, because we use several npm workspaces with quite a few dependencies, and I cannot give access to the company's repository.

@AriPerkkio
Copy link
Member

AriPerkkio commented Jul 27, 2023

There's no need to use StackBlitz if it causes issues. As the message above says, feel free to create a normal Github repository if it's easier. Without being able to reproduce this I don't think we can do anything.

In the System Info section above your environment doesn't seem to have any @vitest/coverage-* packages. Start by checking that every package.json has both vitest and @vitest/covearge-v8 in devDependencies.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 31, 2023
@MERCMS
Copy link
Author

MERCMS commented Jul 31, 2023

Thanks for your feedback. The issue was related to a version conflict with vitest. Different packages had different versions of it installed. After resolving this the error went away.

@github-actions github-actions bot locked and limited conversation to collaborators Aug 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants