-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Labels
Description
Describe the bug
Trying to run vitest in a package of a yarn monorepo will cause the following error:
MISSING DEP Can not find dependency 'vite'
✖ Do you want to install vite? … no
I already have vite installed and apparently the issue is caused by this line:
vitest/packages/vitest/src/utils/index.ts
Line 42 in f557565
| if (isPackageExists(dependency)) |
The local-pkg is not compatible with yarn PnP, as confirmed by this issue.
As far as I understand it, it should be enough to call isPackageExists with a second options parameters like this:
isPackageExists(dependency, { paths: [ process.cwd() ] })I already tested this solution locally with a fork of local-pkg and it works.
Reproduction
The issue is already confirmed.
System Info
System:
OS: Linux 5.10 Ubuntu 20.04.3 LTS (Focal Fossa)
CPU: x64 Intel [redacted]
Memory: 2.72 GB / 7.63 GB
Container: Yes
Shell: 5.0.17 - /bin/bash
Binaries:
Node: 16.13.2 - /usr/bin/node
Yarn: 3.1.1 - /usr/bin/yarn
npm: 8.1.2 - /usr/bin/npmUsed Package Manager
yarn
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Reactions are currently unavailable