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:
|
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/npm
Used Package Manager
yarn
Validations
Describe the bug
Trying to run vitest in a package of a yarn monorepo will cause the following error:
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
The
local-pkgis not compatible with yarn PnP, as confirmed by this issue.As far as I understand it, it should be enough to call
isPackageExistswith a second options parameters like this:I already tested this solution locally with a fork of
local-pkgand 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