Skip to content

Fixing NPM permissions errors on WSL

Saving this one for posterity since I seem to run into something like this once every couple of months. Really gotta get a Mac for my next dev machine. sudo apt update && sudo apt upgrade -y # Since you mention that you have set your user to be root: sudo sh -c 'echo "[user]\ndefault=root" > /etc/wsl.conf' wsl.exe -l -v # Confirm your distribution name for the following command: wsl.exe --terminate Ubuntu Credit to this StackOverflow answer.

brent
Oct 2, 20251 min read

Saving this one for posterity since I seem to run into something like this once every couple of months. Really gotta get a Mac for my next dev machine.

sudo apt update && sudo apt upgrade -y

# Since you mention that you have set your user to be root:
sudo sh -c 'echo "[user]\ndefault=root" > /etc/wsl.conf'

wsl.exe -l -v
# Confirm your distribution name for the following command:
wsl.exe --terminate Ubuntu

Credit to this StackOverflow answer.

Did you enjoy this article?

Recommend it — Standard Reader surfaces well-loved writing to more readers across the network.

Across the AtmosphereDiscussions