claude-code - 💡(How to fix) Fix Cowork VM SDK install on Windows ARM64: hundreds of Operation not permitted errors during node_modules cleanup [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#53396Fetched 2026-04-26 05:16:54
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
labeled ×4

Error Message

Every time the Cowork VM starts up, the SDK refresh step shells out to bash and runs rm against the existing node_modules directory before laying down the new SDK copy. On Windows ARM64 that rm fails for 384 files in a single startup, all with the same error: Operation not permitted. Cowork keeps running afterwards, but:

  • The log gets spammed with hundreds of identical [warn] lines per startup, drowning out real warnings.

Error Messages/Logs

2026-04-25 05:29:15 [warn] [vm-stderr oneshot-] rm: cannot remove 'node_modules/.bin/nanoid': Operation not permitted 2026-04-25 05:29:15 [warn] [vm-stderr oneshot-] rm: cannot remove 'node_modules/.bin/xml-js': Operation not permitted 2026-04-25 05:29:15 [warn] [vm-stderr oneshot-] rm: cannot remove 'node_modules/.package-lock.json': Operation not permitted 2026-04-25 05:29:15 [warn] [vm-stderr oneshot-] rm: cannot remove 'node_modules/@types/node/assert/strict.d.ts': Operation not permitted 2026-04-25 05:29:15 [warn] [vm-stderr oneshot-] rm: cannot remove 'node_modules/@types/node/assert.d.ts': Operation not permitted 2026-04-25 05:29:15 [warn] [vm-stderr oneshot-] rm: cannot remove 'node_modules/@types/node/async_hooks.d.ts': Operation not permitted 2026-04-25 05:29:15 [warn] [vm-stderr oneshot-] rm: cannot remove 'node_modules/@types/node/buffer.buffer.d.ts': Operation not permitted 2026-04-25 05:29:15 [warn] [vm-stderr oneshot-] rm: cannot remove 'node_modules/@types/node/buffer.d.ts': Operation not permitted 2026-04-25 05:29:15 [warn] [vm-stderr oneshot-] rm: cannot remove 'node_modules/@types/node/child_process.d.ts': Operation not permitted 2026-04-25 05:29:15 [warn] [vm-stderr oneshot-] rm: cannot remove 'node_modules/@types/node/cluster.d.ts': Operation not permitted 2026-04-25 05:29:15 [warn] [vm-stderr oneshot-] rm: cannot remove 'package.json': Operation not permitted 2026-04-25 05:29:15 [warn] [vm-stderr oneshot-] rm: cannot remove 'package-lock.json': Operation not permitted 2026-04-25 06:51:52 [warn] [Keepalive] Already running

Code Example

**Stats from one startup:**
- Total `Operation not permitted` warnings: **384**
- Distinct top-level `node_modules` directories affected: **24**
  - `.bin`, `.package-lock.json`, `@types`, `core-util-is`, `docx`, `hash.js`, `immediate`, `inherits`, `isarray`, `jszip`, `lie`, `minimalistic-assert`, `nanoid`, `pako`, `process-nextick-args`, `readable-stream`, `safe-buffer`, `sax`, `setimmediate`, `string_decoder`, `undici-types`, `util-deprecate`, `xml`, `xml-js`
- Files affected include type declarations, license/readme files, top-level entry scripts, and the package's own `package.json`.

**Representative excerpt** (errors fire immediately after the bash one-shot launches):


2026-04-25 05:29:15 [info] [vmOneShot] Running: bash [2 arg(s)] as brave-nifty-einstein
2026-04-25 05:29:15 [warn] [vm-stderr oneshot-] rm: cannot remove 'node_modules/.bin/nanoid': Operation not permitted
2026-04-25 05:29:15 [warn] [vm-stderr oneshot-] rm: cannot remove 'node_modules/.bin/xml-js': Operation not permitted
2026-04-25 05:29:15 [warn] [vm-stderr oneshot-] rm: cannot remove 'node_modules/.package-lock.json': Operation not permitted
2026-04-25 05:29:15 [warn] [vm-stderr oneshot-] rm: cannot remove 'node_modules/@types/node/assert/strict.d.ts': Operation not permitted
2026-04-25 05:29:15 [warn] [vm-stderr oneshot-] rm: cannot remove 'node_modules/@types/node/assert.d.ts': Operation not permitted
2026-04-25 05:29:15 [warn] [vm-stderr oneshot-] rm: cannot remove 'node_modules/@types/node/async_hooks.d.ts': Operation not permitted
2026-04-25 05:29:15 [warn] [vm-stderr oneshot-] rm: cannot remove 'node_modules/@types/node/buffer.buffer.d.ts': Operation not permitted
2026-04-25 05:29:15 [warn] [vm-stderr oneshot-] rm: cannot remove 'node_modules/@types/node/buffer.d.ts': Operation not permitted
2026-04-25 05:29:15 [warn] [vm-stderr oneshot-] rm: cannot remove 'node_modules/@types/node/child_process.d.ts': Operation not permitted
2026-04-25 05:29:15 [warn] [vm-stderr oneshot-] rm: cannot remove 'node_modules/@types/node/cluster.d.ts': Operation not permitted
... (374 more identical-pattern lines) ...
2026-04-25 05:29:15 [warn] [vm-stderr oneshot-] rm: cannot remove 'package.json': Operation not permitted
2026-04-25 05:29:15 [warn] [vm-stderr oneshot-] rm: cannot remove 'package-lock.json': Operation not permitted


**After the failed cleanup, normal operation continues:**


2026-04-25 06:51:50 [info] [startVM] VM already connected
2026-04-25 06:51:50 [info] [postConnect] Installing SDK: subpath=c/Users/<user>/AppData/Roaming/Claude/claude-code-vm, version=2.1.119
2026-04-25 06:51:52 [warn] [Keepalive] Already running


The `[Keepalive] Already running` warning suggests the previous Cowork VM process is still alive when `rm` runs — a likely contributor to the file-locking failures.
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Cowork VM SDK install on Windows ARM64: hundreds of Operation not permitted errors during node_modules cleanup

Environment

  • OS: Windows 11 ARM64 (Snapdragon Lenovo laptop)
  • Claude Desktop: 1.4758.0.0 (arm64 MSIX, installed from Microsoft Store)
  • Update channel: https://api.anthropic.com/api/desktop/win32/arm64/msix/update
  • Cowork SDK version: 2.1.119
  • Cowork install path: C:\Users\<user>\AppData\Roaming\Claude\claude-code-vm\2.1.119\
  • Log file: %APPDATA%\Claude\logs\cowork_vm_node.log

What's wrong

Every time the Cowork VM starts up, the SDK refresh step shells out to bash and runs rm against the existing node_modules directory before laying down the new SDK copy. On Windows ARM64 that rm fails for 384 files in a single startup, all with the same error: Operation not permitted. Cowork keeps running afterwards, but:

  • The cleanup never actually completes — old SDK files are left behind on disk.
  • The log gets spammed with hundreds of identical [warn] lines per startup, drowning out real warnings.
  • Stale modules accumulate over time. Eventually a file from an old SDK version may be resolved instead of the new one, causing hard-to-debug MODULE_NOT_FOUND or version-mismatch failures.

What Should Happen?

What should happen

Starting the Cowork VM should produce a clean SDK install:

  • Old node_modules files are removed cleanly before the new SDK is laid down.
  • The log shows a normal install sequence with no Operation not permitted warnings.
  • No stale files remain in claude-code-vm\<version>\node_modules\.

Error Messages/Logs

**Stats from one startup:**
- Total `Operation not permitted` warnings: **384**
- Distinct top-level `node_modules` directories affected: **24**
  - `.bin`, `.package-lock.json`, `@types`, `core-util-is`, `docx`, `hash.js`, `immediate`, `inherits`, `isarray`, `jszip`, `lie`, `minimalistic-assert`, `nanoid`, `pako`, `process-nextick-args`, `readable-stream`, `safe-buffer`, `sax`, `setimmediate`, `string_decoder`, `undici-types`, `util-deprecate`, `xml`, `xml-js`
- Files affected include type declarations, license/readme files, top-level entry scripts, and the package's own `package.json`.

**Representative excerpt** (errors fire immediately after the bash one-shot launches):


2026-04-25 05:29:15 [info] [vmOneShot] Running: bash [2 arg(s)] as brave-nifty-einstein
2026-04-25 05:29:15 [warn] [vm-stderr oneshot-] rm: cannot remove 'node_modules/.bin/nanoid': Operation not permitted
2026-04-25 05:29:15 [warn] [vm-stderr oneshot-] rm: cannot remove 'node_modules/.bin/xml-js': Operation not permitted
2026-04-25 05:29:15 [warn] [vm-stderr oneshot-] rm: cannot remove 'node_modules/.package-lock.json': Operation not permitted
2026-04-25 05:29:15 [warn] [vm-stderr oneshot-] rm: cannot remove 'node_modules/@types/node/assert/strict.d.ts': Operation not permitted
2026-04-25 05:29:15 [warn] [vm-stderr oneshot-] rm: cannot remove 'node_modules/@types/node/assert.d.ts': Operation not permitted
2026-04-25 05:29:15 [warn] [vm-stderr oneshot-] rm: cannot remove 'node_modules/@types/node/async_hooks.d.ts': Operation not permitted
2026-04-25 05:29:15 [warn] [vm-stderr oneshot-] rm: cannot remove 'node_modules/@types/node/buffer.buffer.d.ts': Operation not permitted
2026-04-25 05:29:15 [warn] [vm-stderr oneshot-] rm: cannot remove 'node_modules/@types/node/buffer.d.ts': Operation not permitted
2026-04-25 05:29:15 [warn] [vm-stderr oneshot-] rm: cannot remove 'node_modules/@types/node/child_process.d.ts': Operation not permitted
2026-04-25 05:29:15 [warn] [vm-stderr oneshot-] rm: cannot remove 'node_modules/@types/node/cluster.d.ts': Operation not permitted
... (374 more identical-pattern lines) ...
2026-04-25 05:29:15 [warn] [vm-stderr oneshot-] rm: cannot remove 'package.json': Operation not permitted
2026-04-25 05:29:15 [warn] [vm-stderr oneshot-] rm: cannot remove 'package-lock.json': Operation not permitted


**After the failed cleanup, normal operation continues:**


2026-04-25 06:51:50 [info] [startVM] VM already connected
2026-04-25 06:51:50 [info] [postConnect] Installing SDK: subpath=c/Users/<user>/AppData/Roaming/Claude/claude-code-vm, version=2.1.119
2026-04-25 06:51:52 [warn] [Keepalive] Already running


The `[Keepalive] Already running` warning suggests the previous Cowork VM process is still alive when `rm` runs — a likely contributor to the file-locking failures.

Steps to Reproduce

Steps to reproduce

  1. Use a Windows 11 ARM64 device (Snapdragon — e.g. Lenovo with X Elite/Plus).
  2. Install Claude Desktop from the Microsoft Store (arm64 MSIX, version 1.4758.0.0 or later).
  3. Sign in and enable Cowork mode in settings.
  4. Open any Cowork session — the SDK install runs on first connection and again on every subsequent startup that detects a version delta.
  5. Open %APPDATA%\Claude\logs\cowork_vm_node.log in any text editor.
  6. Search for the string Operation not permitted. You will see hundreds of matches, all generated within the same second by a single [vmOneShot] Running: bash invocation.

Claude Model

Not sure / Multiple models

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.119

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

WSL (Windows Subsystem for Linux)

Additional Information

Likely cause

The Cowork sandbox appears to run a Linux userland on top of the Windows host filesystem (the SDK target path c/Users/<user>/AppData/Roaming/Claude/claude-code-vm is a Linux-style mount of the Windows path). Linux rm relies on POSIX unlink semantics, which work fine on files held open by other processes. NTFS does not — if a file is held open without FILE_SHARE_DELETE, unlink fails with EPERM (Operation not permitted).

Candidate processes holding handles on these files at refresh time:

  • A long-running node worker inside the sandbox itself (the [Keepalive] Already running log line immediately after the failures suggests the previous VM process is still up).
  • Windows Defender / MsMpEng scanning newly written files.
  • Any third-party antivirus or endpoint protection.

The fact that the failures hit dozens of unrelated packages in one sweep — including read-only .d.ts files that nothing should be writing to — points more at a filesystem-semantics mismatch than at a real lock-holder.

Suggested fixes

  1. Stop the previous Cowork VM process (and its worker tree) before running the cleanup, not after — current order looks like the keepalive process is still alive when rm runs.
  2. Fall back to a Windows-aware delete (MoveFileEx ... MOVEFILE_DELAY_UNTIL_REBOOT for files that can't be unlinked, or shell out to PowerShell Remove-Item -Force -Recurse, which uses CreateFile with FILE_SHARE_DELETE).
  3. Use content-addressed install dirs (claude-code-vm/<version>/<sha>) so refreshes never need to delete anything — just create a new dir and update a symlink.
  4. At minimum, suppress the per-file warnings and emit one summary line rm: failed to clean N of M files in <path> so the log stays useful.

Anything else

Happy to provide the full cowork_vm_node.log (~90 KB), main.log, or run any diagnostic commands. Chrome MCP and the rest of Claude Desktop are working fine — this is isolated to the Cowork SDK install/refresh path.

cowork_vm_node.log

extent analysis

TL;DR

The most likely fix for the "Operation not permitted" errors during Cowork VM SDK install on Windows ARM64 is to stop the previous Cowork VM process before running the cleanup or use a Windows-aware delete method.

Guidance

  • Verify that the previous Cowork VM process is stopped before running the cleanup by checking the [Keepalive] Already running log line.
  • Consider using a Windows-aware delete method, such as MoveFileEx with MOVEFILE_DELAY_UNTIL_REBOOT or shell out to PowerShell Remove-Item -Force -Recurse.
  • Review the suggested fixes provided in the issue, including using content-addressed install dirs or suppressing per-file warnings.
  • Check the log file %APPDATA%\Claude\logs\cowork_vm_node.log for any other errors or warnings that may be related to the issue.

Example

No code snippet is provided as it is not explicitly supported by the issue.

Notes

The issue seems to be related to the filesystem-semantics mismatch between Linux and Windows, and the provided suggested fixes may help resolve the issue. However, further investigation and testing may be required to determine the root cause and the most effective solution.

Recommendation

Apply a workaround, such as stopping the previous Cowork VM process before running the cleanup or using a Windows-aware delete method, as the issue is likely related to the filesystem-semantics mismatch and not a bug in the code.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING