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 module @rollup/rollup-darwin-x64 on MAC with M3 processor #435

Closed
4 tasks done
badiuoanaalexandra opened this issue Jul 16, 2024 · 7 comments
Closed
4 tasks done

Comments

@badiuoanaalexandra
Copy link

badiuoanaalexandra commented Jul 16, 2024

Describe the bug

I installed vitest extension and I get error
"Error: Vitest failed to start:
Error: Cannot find module @rollup/rollup-darwin-x64"
I have an Apple M3 Pro processor and cannot install @rollup/rollup-darwin-x64 lib. I tried installing @rollup/rollup-darwin-arm64, but that didn't fix the issue.

Reproduction

Install latest version of vitest extension v1.0.1, vite 5.3.3 and vitest 2.0.1 on a MAC that uses M3 processor, OS darwin and arm64 CPU. Start VSCode.

You'll see error in the Output. Deleting package lock and node modules and running "npm i" again doesn't fix issue.
Error: Vitest failed to start:
Error: Cannot find module @rollup/rollup-darwin-x64. npm has a bug related to optional dependencies (npm/cli#4828). Please try npm i again after removing both package-lock.json and node_modules directory.
at requireWithFriendlyError (/Users/oana.badiu/Code/directions-debug-v2/node_modules/rollup/dist/native.js:59:9)
at Object. (/Users/oana.badiu/Code/directions-debug-v2/node_modules/rollup/dist/native.js:68:76)
at Module._compile (node:internal/modules/cjs/loader:1378:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1437:10)
at Module.load (node:internal/modules/cjs/loader:1212:32)
at Module._load (node:internal/modules/cjs/loader:1028:12)
at cjsLoader (node:internal/modules/esm/translators:359:17)
at ModuleWrap. (node:internal/modules/esm/translators:308:7)
at ModuleJob.run (node:internal/modules/esm/module_job:218:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:323:24)
at ChildProcess.f (/Users/oana.badiu/.vscode/extensions/vitest.explorer-1.0.1/dist/extension.js:18:5548)
at ChildProcess.emit (node:events:514:28)
at emit (node:internal/child_process:951:14)
at process.processTicksAndRejections (node:internal/process/task_queues:83:21)

Output

Error: Vitest failed to start: 
Error: Cannot find module @rollup/rollup-darwin-x64. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). Please try `npm i` again after removing both package-lock.json and node_modules directory.
    at requireWithFriendlyError (/Users/oana.badiu/Code/directions-debug-v2/node_modules/rollup/dist/native.js:59:9)
    at Object.<anonymous> (/Users/oana.badiu/Code/directions-debug-v2/node_modules/rollup/dist/native.js:68:76)
    at Module._compile (node:internal/modules/cjs/loader:1378:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1437:10)
    at Module.load (node:internal/modules/cjs/loader:1212:32)
    at Module._load (node:internal/modules/cjs/loader:1028:12)
    at cjsLoader (node:internal/modules/esm/translators:359:17)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:308:7)
    at ModuleJob.run (node:internal/modules/esm/module_job:218:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:323:24)
	at ChildProcess.f (/Users/oana.badiu/.vscode/extensions/vitest.explorer-1.0.1/dist/extension.js:18:5548)
	at ChildProcess.emit (node:events:514:28)
	at emit (node:internal/child_process:951:14)
	at process.processTicksAndRejections (node:internal/process/task_queues:83:21)

Version

v1.0.1

Validations

@sheremet-va
Copy link
Member

Does Vitest work for you without the extension?

@badiuoanaalexandra
Copy link
Author

badiuoanaalexandra commented Jul 16, 2024

Running vitest in the terminal without the extension works fine.

@badiuoanaalexandra
Copy link
Author

badiuoanaalexandra commented Jul 16, 2024

If it helps, vitest extension version v0.5.15 used to work when using vitest 1.4.0, however this version of the extension is not available anymore for download it seems and also it doesn't work with vitest latest 2.0.1

@sheremet-va
Copy link
Member

It doesn't really help. I don't think the problem is with OS, I will need a minimal reproduction to looks into this. Try creating a simple project - does it work on your PC out of the box?

@badiuoanaalexandra
Copy link
Author

The extension does work with the simple project so must be something in my repo that is causing it to crash. Weird that this didn't happen with v0.5.15. I'll look more into it on my side. Thanks for the quick response.

@sheremet-va
Copy link
Member

The extension does work with the simple project so must be something in my repo that is causing it to crash. Weird that this didn't happen with v0.5.15. I'll look more into it on my side. Thanks for the quick response.

Maybe you don't have the config in the root? The extension uses the config directory as cwd, - maybe that's why it can't find the package?

@badiuoanaalexandra
Copy link
Author

I actually found the problematic package. We are using rsbuild instead of vite for actually building the project and it looks like @rspack/binding-darwin-arm64 was somehow interfering. Updating this package to latest version seems to have fixed my issue.

@github-actions github-actions bot locked and limited conversation to collaborators Aug 1, 2024
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