This error occurs when npm fails to create symbolic links during npm link or global package installation. Usually caused by missing directories, incorrect npm prefix configuration, or filesystem limitations.
The ENOENT (Error NO ENTry) with "syscall symlink" means npm is trying to create a symbolic link but can't find the destination directory. This typically happens during `npm link` operations or global package installations. When you run `npm link` in a package directory, npm creates a symlink from your global node_modules to your local package. If the global npm directories don't exist or are misconfigured, this error occurs. This is especially common after upgrading Node.js or npm, when using version managers like nvm, or on filesystems that don't support symlinks (Windows shared folders, some VirtualBox configurations).
First, verify your npm prefix and create missing directories:
# Check current npm prefix
npm config get prefix
# Check if lib/node_modules exists
ls -la $(npm config get prefix)/lib/node_modules
# If missing, create it
mkdir -p $(npm config get prefix)/lib/node_modulesEnsure you own the npm directories:
# Fix ownership (Linux/macOS)
sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}
# Verify you can write to it
touch $(npm config get prefix)/lib/node_modules/test && rm $(npm config get prefix)/lib/node_modules/testConfigure npm to use a directory in your home folder:
# Create a directory for global packages
mkdir -p ~/.npm-global
# Configure npm to use it
npm config set prefix ~/.npm-global
# Add to your PATH (add to ~/.bashrc or ~/.zshrc)
export PATH=~/.npm-global/bin:$PATH
# Reload shell config
source ~/.bashrcNow npm link and global installs will work without permission issues.
After fixing the directories:
# In your package directory
cd /path/to/my-package
npm link
# Then in your project
cd /path/to/my-project
npm link my-package
# Verify it worked
npm ls -g --depth=0If your filesystem doesn't support symlinks (Windows/VirtualBox):
npm install --no-bin-links
npm link --no-bin-linksThis copies files instead of creating symlinks.
NVM Users: Each Node.js version has its own global npm directory. When you switch Node versions with nvm use, you may need to re-link packages.
Windows Symlinks: Windows requires admin privileges or Developer Mode to create symlinks. Run PowerShell as Administrator, or enable Developer Mode in Windows Settings.
VirtualBox Shared Folders: Enable symlinks in VM settings:
VBoxManage setextradata "VM_NAME" VBoxInternal2/SharedFoldersEnableSymlinksCreate/SHARE_NAME 1Docker/Vagrant: Symlinks in shared/mounted folders often fail. Either:
- Install node_modules inside the container (not in shared folder)
- Use --no-bin-links
- Use a Docker named volume for node_modules
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