2

I am using Ubuntu 20.04.1 LTS on WSL2 and out of nowhere, I get this error upon starting up my shell.

Error: EIO: i/o error, scandir '/mnt/c/Users/computer'
nvm is not compatible with the npm config "prefix" option: currently set to ""
Run `npm config delete prefix` or `nvm use --delete-prefix v14.0.0 --silent` to unset it.

So, I tried looking up the EIO i/o error, but no dice. There was a solution for the npm config prefix problem, but instead I ran into the EIO i/o error again. I attempted using nvm to reinstall v14.0.0 but that just output the error lines above. I reinstalled nvm and let it install 14.0.0 but the error persisted.

I am able to use node, but trying to use npm gives the EIO error.

What do I do?

unhappycat
  • 406
  • 1
  • 4
  • 16
  • This problem has somehow disappeared sometime over the past year and I have no idea why. Sorry to be a DenverCoder9. – unhappycat Jul 17 '22 at 02:17

1 Answers1

1

From Here

The short version is to add this section to your WSL instance’s /etc/wsl.conf (the file probably does not exist, just create it):

[automount]
enabled = true
options = "metadata,umask=22,fmask=11"

What it Does You can read the “official” Microsoft documentation on their Dev Blog but here is my explanation line-by-line: The automount section changes the settings for drives that are automounted under /mnt The enabled key is probably unnecessary but it explicitly turns on automounting (default is true) The options key is a bit more interesting: metadata turns on a mostly parallel of file permission metadata that allows WSL file permissions changes to be persisted. It partially affects the underlying Windows permissions; for more details see the Dev Blog link above. umask value masks out (i.e. unsets) the group and others write bit for both files and directories fmask value masks out the group and others execute bit for just files Files should now show up with a comfortable permission setting of 0644 and directories with 0755 if they’re mounted under /mnt.

Don't forget to restart after change.

shdr
  • 868
  • 10
  • 25