Skip to content
Latchkey

npm "EEXIST: symlink" concurrent install in CI

npm tried to create a symlink (usually a CLI shim in node_modules/.bin) that already existed. This EEXIST on symlink is a classic concurrent-install race rather than a genuine duplicate.

What this error means

Install fails with "EEXIST: file already exists, symlink" naming a path in node_modules/.bin. Retrying succeeds, indicating two installs touched the same tree at once.

node
npm error code EEXIST
npm error syscall symlink
npm error path /work/repo/node_modules/.bin/tsc
npm error EEXIST: file already exists, symlink '../typescript/bin/tsc'

Common causes

Two installs racing on one tree

Parallel installs (matrix jobs or a re-entrant postinstall) both try to create the same .bin symlink.

A leftover symlink from an interrupted install

A killed install left a dangling symlink that the next install cannot recreate.

How to fix it

Use a clean tree and a single installer

Remove node_modules and run exactly one install to recreate the symlinks.

Terminal
rm -rf node_modules
npm ci

Isolate parallel job workspaces

Give each concurrent job its own checkout so symlink creation never overlaps.

  1. Avoid sharing node_modules across parallel jobs.
  2. Key caches per job to prevent simultaneous writes.
  3. Clean .bin before reinstalling if a job was interrupted.

How to prevent it

  • Never run two installs against one node_modules concurrently.
  • Reinstall from a clean tree with npm ci.
  • Latchkey self-healing managed runners auto-retry transient EEXIST symlink races and isolate workspaces per job so concurrent installs do not collide.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →