-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed as not planned
Closed as not planned
Copy link
Description
Describe the bug
Ignoring the fact #4575 caused vite to be falsely reported as missing, I went ahead and asked for it to be installed.
I got an error:
file:///.yarn/__virtual__/vitest-virtual-64d4633324/0/cache/vitest-npm-1.0.1-9a3034a0e7-e59bab2c0a.zip/node_modules/vitest/dist/chunks/install-pkg.ORGzQeqb.js:5
import execa from 'execa';
^^^^^
SyntaxError: The requested module 'execa' does not provide an export named 'default'
at ModuleJob._instantiate (node:internal/modules/esm/module_job:131:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:213:5)
at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)
at async ensurePackageInstalled (file:///.yarn/__virtual__/vitest-virtual-64d4633324/0/cache/vitest-npm-1.0.1-9a3034a0e7-e59bab2c0a.zip/node_modules/vitest/dist/vendor/node.mLeBfrTn.js:84:12)
at async startVitest (file:///.yarn/__virtual__/vitest-virtual-64d4633324/0/cache/vitest-npm-1.0.1-9a3034a0e7-e59bab2c0a.zip/node_modules/vitest/dist/vendor/node.mLeBfrTn.js:14782:8)
at async start (file:///.yarn/__virtual__/vitest-virtual-64d4633324/0/cache/vitest-npm-1.0.1-9a3034a0e7-e59bab2c0a.zip/node_modules/vitest/dist/cli.js:134:17)
I tracked it down to a bundled version of @antfu/install-pkg version 0.1.1, which at the time was using a different, older version of execa that provided default exports. Since this dependency is bundled, it's using the same execa version vitest declares, and consequently, it errors out.
Suggested fix:
Update @antfu/install-pkg which since then has been updated not to use default export in execa.
Reproduction
- Install vitest using Yarn PnP
- Run vitest
- Upon facing
confirm installation
MISSING DEP Can not find dependency 'vite' ? Do you want to install vite? › (y/N)
System Info
System:
OS: macOS 14.1.1
CPU: (8) arm64 Apple M2
Memory: 32.31 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.9.0 - /private/var/folders/3y/swkjq1x101b76mzjgt4pm2d80000gp/T/xfs-2ac5acc4/node
Yarn: 4.0.2 - /private/var/folders/3y/swkjq1x101b76mzjgt4pm2d80000gp/T/xfs-2ac5acc4/yarn
npm: 10.1.0 - /usr/local/bin/npm
bun: 1.0.12 - ~/.bun/bin/bun
Browsers:
Chrome: 119.0.6045.199
Edge: 119.0.2151.97
Safari: 17.1Used 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
Metadata
Metadata
Assignees
Labels
No labels