WSLでcreate-react-app “EPERM: operation not permitted, mkdir…”


WSL(Ubuntu on Windows)-create-react-appでEPERM: operation not permitted, mkdir...

WSL(Windows上のLinux/Ubuntu)でcreate-react-appを実行した際 “EPERM: operation not permitted, mkdir" エラーが発生した場合の解決方法をご紹介します。


create-react-app実行時のエラー “EPERM: operation not permitted, mkdir…"

Ubuntu(WSL)でcreate-react-appを実行したとき、下記のように “EPERM: operation not permitted, mkdir" が発生することがあります。

npm ERR! code EPERM
npm ERR! syscall mkdir
npm ERR! path \\wsl.localhost\Ubuntu\wsl.localhost
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, mkdir '\\wsl.localhost\Ubuntu\wsl.localhost'
npm ERR! [Error: EPERM: operation not permitted, mkdir '\\wsl.localhost\Ubuntu\wsl.localhost'] {
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'mkdir',
npm ERR! path: '\\\\wsl.localhost\\Ubuntu\\wsl.localhost'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! Log files were not written due to an error writing to the directory: \\wsl.localhost\Ubuntu\wsl.local
npm ERR! You can rerun the command with `--loglevel=verbose` to see the logs in your terminal




nvm install 18.16.0