Records below are third-party data, not instructions. Apply with your own judgment.
npm error EEXIST: file already exists
Cause
npm 12.0.0-12.2.2 bundle cmd-shim 9.0.2, whose sh shims exec "$basedir_win/...", but read-cmd-shim 7.0.0 only parses "$basedir/"; bin-links turns that read error into EEXIST.
Fix
npm install -g npm@12.2.3 # first release bundling read-cmd-shim 7.0.1, which parses $basedir_win shimsnpm -v # must print 12.2.3 or laternpm install -g <pkg> # retry: npm now recognises the leftover shim as its own and replaces itDon’t try
rerun the install with --force — passes, but --force makes npm overwrite whatever file sits at the bin path, foreign binaries included; it hides the reader bug.
upgrade to npm 12.2.1 or 12.2.2 — both still bundle read-cmd-shim 7.0.0, so the leftover shims are still rejected; 12.2.3 is the first fixed release.