Skip to content

Fatal error during initialization: ENOTEMPTY, Directory not empty #777

Description

@svcITA

Installed latest version of VSCode and installed latest version of TestMyCode. Extension fails to initialize when you click on its icon in the navigation bar.

Steps to reproduce the behavior:

  1. Open 'VS Code'
  2. Click on 'TMC' extension
  3. See error

OS: Windows 11
VSCode Version 1.123.0
TMC Extension Version 3.5.1

TMC Extension logs:

[2026-06-06 15:09:23:426] [INFO] Starting moocfi.test-my-code in "production" mode.
[2026-06-06 15:09:23:426] [INFO] Visual Studio Code version: 1.123.0
[2026-06-06 15:09:23:426] [INFO] moocfi.test-my-code version: 3.5.1
[2026-06-06 15:09:23:426] [INFO] Currently open workspace: undefined
[2026-06-06 15:09:23:426] [INFO] Platform win32 Arch x64
[2026-06-06 15:09:23:426] [INFO] TMC-Langs version: tmc-langs-cli-x86_64-pc-windows-msvc-0.39.4.exe
[2026-06-06 15:09:23:429] [INFO] Downloading TMC-langs from https://download.mooc.fi/tmc-langs-rust/tmc-langs-cli-x86_64-pc-windows-msvc-0.39.4.exe to temporary file c:\Users\Logan Johnson\AppData\Roaming\Code\User\globalStorage\moocfi.test-my-code\cli\temp-tmc-langs-cli-x86_64-pc-windows-msvc-0.39.4.exe
[2026-06-06 15:09:27:678] [ERROR] Mismatch between CLI and checksum, trying redownload
[2026-06-06 15:09:27:678] [DEBUG] CLI "2a31f5758b4488b279e80e57ff8248aa2485ef80d4cf27618403fb136fc07f71", hash ""
[2026-06-06 15:09:27:681] [ERROR] Fatal error during initialization:
Error: ENOTEMPTY, Directory not empty: \?\c:\Users\Logan Johnson\AppData\Roaming\Code\User\globalStorage\moocfi.test-my-code\cli '\?\c:\Users\Logan Johnson\AppData\Roaming\Code\User\globalStorage\moocfi.test-my-code\cli'.

Error: ENOTEMPTY, Directory not empty: \?\c:\Users\Logan Johnson\AppData\Roaming\Code\User\globalStorage\moocfi.test-my-code\cli '\?\c:\Users\Logan Johnson\AppData\Roaming\Code\User\globalStorage\moocfi.test-my-code\cli'
at Object.rmSync (node:fs:1223:18)
at c:\Users\Logan Johnson.vscode\extensions\moocfi.test-my-code-3.5.1\dist\lib.js:2:461189
at Array.map ()
at ye (c:\Users\Logan Johnson.vscode\extensions\moocfi.test-my-code-3.5.1\dist\lib.js:2:461148)
at t.ensureLangsUpdated (c:\Users\Logan Johnson.vscode\extensions\moocfi.test-my-code-3.5.1\dist\lib.js:2:243997)
at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
at async c:\Users\Logan Johnson.vscode\extensions\moocfi.test-my-code-3.5.1\dist\extension.js:1:1508
at async r.activate (c:\Users\Logan Johnson.vscode\extensions\moocfi.test-my-code-3.5.1\dist\extension.js:1:1063)
at async Mb._activate (file:///c:/Users/Logan%20Johnson/AppData/Local/Programs/Microsoft%20VS%20Code/6a44c352bd/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:530:16021)
at async Mb._waitForDepsThenActivate (file:///c:/Users/Logan%20Johnson/AppData/Local/Programs/Microsoft%20VS%20Code/6a44c352bd/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:530:15963)
at async Mb._initialize (file:///c:/Users/Logan%20Johnson/AppData/Local/Programs/Microsoft%20VS%20Code/6a44c352bd/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:530:15330)

Observations:

It looks like it does a hash comparison, finds no file and exits. I manually downloaded the file it was trying to look for (https://download.mooc.fi/tmc-langs-rust/tmc-langs-cli-x86_64-pc-windows-msvc-0.39.4.exe) and placed it in the directory it was complaining is empty (c:\Users\Logan Johnson\AppData\Roaming\Code\User\globalStorage\moocfi.test-my-code\cli).

This changed the error to this:

[2026-06-06 15:26:53:970] [INFO] Starting moocfi.test-my-code in "production" mode.
[2026-06-06 15:26:53:970] [INFO] Visual Studio Code version: 1.123.0
[2026-06-06 15:26:53:970] [INFO] moocfi.test-my-code version: 3.5.1
[2026-06-06 15:26:53:970] [INFO] Currently open workspace: undefined
[2026-06-06 15:26:53:970] [INFO] Platform win32 Arch x64
[2026-06-06 15:26:53:970] [INFO] TMC-Langs version: tmc-langs-cli-x86_64-pc-windows-msvc-0.39.4.exe
[2026-06-06 15:26:54:215] [ERROR] Fatal error during initialization:
Error: ENOENT: no such file or directory, open 'c:\Users\Logan Johnson\AppData\Roaming\Code\User\globalStorage\moocfi.test-my-code\cli\tmc-langs-cli-x86_64-pc-windows-msvc-0.39.4.exe.sha256'.

Error: ENOENT: no such file or directory, open 'c:\Users\Logan Johnson\AppData\Roaming\Code\User\globalStorage\moocfi.test-my-code\cli\tmc-langs-cli-x86_64-pc-windows-msvc-0.39.4.exe.sha256'
at Object.readFileSync (node:fs:442:20)
at t.readFileSync (node:electron/js2c/node_init:2:11049)
at t.ensureLangsUpdated (c:\Users\Logan Johnson.vscode\extensions\moocfi.test-my-code-3.5.1\dist\lib.js:2:243813)
at c:\Users\Logan Johnson.vscode\extensions\moocfi.test-my-code-3.5.1\dist\extension.js:1:1516
at r.activate (c:\Users\Logan Johnson.vscode\extensions\moocfi.test-my-code-3.5.1\dist\extension.js:1:5517)
at Od._callActivateOptional (file:///c:/Users/Logan%20Johnson/AppData/Local/Programs/Microsoft%20VS%20Code/6a44c352bd/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:534:18592)
at Od._callActivate (file:///c:/Users/Logan%20Johnson/AppData/Local/Programs/Microsoft%20VS%20Code/6a44c352bd/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:534:18302)
at file:///c:/Users/Logan%20Johnson/AppData/Local/Programs/Microsoft%20VS%20Code/6a44c352bd/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:534:16276
at async Mb._activate (file:///c:/Users/Logan%20Johnson/AppData/Local/Programs/Microsoft%20VS%20Code/6a44c352bd/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:530:16021)
at async Mb._waitForDepsThenActivate (file:///c:/Users/Logan%20Johnson/AppData/Local/Programs/Microsoft%20VS%20Code/6a44c352bd/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:530:15963)
at async Mb._initialize (file:///c:/Users/Logan%20Johnson/AppData/Local/Programs/Microsoft%20VS%20Code/6a44c352bd/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:530:15330)

It looks like now it wants the file renamed to have .sha256 at the end, I renamed the file and tried enabling the extension again. The file disappears and we go back to the previous, "Error: ENOTEMPTY, Directory not empty:" error message.

I have also tried to install VSCode and the TMC extension on two other computers I own (including one that is a fresh OOBE Windows 11 install) and got the same issue, which leads me to believe the problem is not my environment, rather a coding issue with the extension.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions