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

EPERM: operation not permitted, scandir '/Library/Application Support/com.apple.TCC' #2666

Closed
6 tasks done
wbiller opened this issue Jan 14, 2023 · 2 comments
Closed
6 tasks done

Comments

@wbiller
Copy link

wbiller commented Jan 14, 2023

Describe the bug

Hi all,

I believe someone injected some malware into vitest@0.27.1. After a fresh install I'm greeted with this nice message. vitest@~0.26.0 works.

vitest run

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Unhandled Error ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
[Error: EPERM: operation not permitted, scandir '/Library/Application Support/com.apple.TCC'] {
  errno: -1,
  code: 'EPERM',
  syscall: 'scandir',
  path: '/Library/Application Support/com.apple.TCC'
}

Reproduction

yarn add --dev vitest@0.27.1
./node_modules/.bin/vitest

System Info

System:
    OS: macOS 13.1
    CPU: (10) arm64 Apple M1 Max
    Memory: 565.36 MB / 32.00 GB
    Shell: 3.6.0 - /opt/homebrew/bin/fish
  Binaries:
    Node: 18.11.0 - ~/.local/share/nvm/v18.11.0/bin/node
    Yarn: 1.22.19 - ~/.local/share/nvm/v18.11.0/bin/yarn
    npm: 8.19.2 - ~/.local/share/nvm/v18.11.0/bin/npm
  Browsers:
    Chrome: 109.0.5414.87
    Safari: 16.2
  npmPackages:
    vite: ~4.0.0 => 4.0.4
    vitest: ~0.27.0 => 0.27.1

Used Package Manager

yarn

Validations

@AriPerkkio
Copy link
Member

Could you share your vite.config.ts as well? There could be a glob pattern or absolute path that accidentally starts from the root of the file system, instead of project root.

I can reproduce the issue by adding { test: { root: '/' } } in configuration. Using process.cwd() instead fixes the issue.

import { defineConfig } from "vitest/config";

export default defineConfig({
  test: {
-    root: '/',
+    root: process.cwd(),
  },
});

Related to #2637?

@wbiller
Copy link
Author

wbiller commented Jan 15, 2023

Yes, you're right. root was set to '/'. Thank you very much!
The issue can be closed.

@wbiller wbiller closed this as completed Jan 15, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jun 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants