-1

I was facing this exact error every time I tried to run a Nest project locally via VSCode and I didn't find anything related to it on the internet, so I'm gonna post a question and the answer I found to my specific context.

Error  EBUSY: resource busy or locked, rmdir 'C:\code\Pessoal\Magic3t-Backend\dist'

Context:

  • I'm using Nest.js
  • I have some Vitest tests and Vitest extension installed
  • The error disappears if I run it directly via console or manually delete the folder

1 Answer 1

0

The problem was that I forgot to exclude my vitest.config.ts from tsconfig.build.json, as shown below.
enter image description here

It made vitest.config.ts get compiled into a vitest.config.js inside the dist folder:
enter image description here

Which made the extension think it should consider that file and locked it for some reason (I don't know why, to be honest).
Adding vitest.config.ts to exclude solved my problem.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.