npm failed to set executable bits on an installed file because the path is not writable or the filesystem blocks chmod. Use user-owned prefixes, fix ownership, or move off read-only/NTFS mounts.
npm calls chmod to mark binaries executable in node_modules/.bin or in the global bin directory. If the target is owned by root, mounted read-only, or on a filesystem that ignores POSIX modes (NTFS/SMB), chmod returns EACCES and npm aborts the install. This often happens after sudo installs leave root-owned files, when installing globally to /usr/local as a non-root user, in WSL2 working on /mnt/c (NTFS), or in Docker/CI when npm runs as a non-owner of the mounted volume.
stat <path>
mount | grep $(df -P <path> | tail -1 | awk '{print $1}')sudo chown -R $(whoami) .
sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}npm config set cache ~/.npm-cache
mkdir -p ~/.npm-global
npm config set prefix ~/.npm-global
export PATH="$HOME/.npm-global/bin:$PATH"On WSL, clone to ~/projects (ext4) instead of /mnt/c. Avoid installing from network shares; use a local clone to allow chmod.
rm -rf node_modules package-lock.json
npm cache clean --force
npm ciRun containers with --user matching host UID/GID or chown the workspace volume so chmod can apply executable bits.
noexec mounts (some corporate images, secure /tmp) will block chmod even for the owner; install on a writable, exec-capable path instead. Homebrew installs under /opt/homebrew can drift to root-owned after OS updates—using nvm/fnm keeps npm files in $HOME. In Windows/WSL, NTFS ignores Unix execute bits; keep projects on the Linux filesystem to ensure binaries are executable.
npm ERR! code ENOAUDIT npm ERR! Audit endpoint not supported
How to fix "npm ERR! code ENOAUDIT - Audit endpoint not supported"
npm ERR! code EBADDEVENGINES npm ERR! devEngines.runtime incompatible with current node version
How to fix "npm ERR! code EBADDEVENGINES - devEngines.runtime incompatible with current node version"
npm ERR! code ETOOMANYARGS npm ERR! Too many arguments
How to fix "npm ERR! code ETOOMANYARGS - Too many arguments"
npm ERR! code EINVALIDTAGNAME npm ERR! Invalid tag name: tag names cannot contain spaces
How to fix "npm ERR! code EINVALIDTAGNAME - tag names cannot contain spaces"
npm ERR! code E400 npm ERR! 400 Bad Request
How to fix "npm ERR! code E400 - 400 Bad Request" error