agodoo
agodoo

Reputation: 539

NPM stuck giving error EISDIR: illegal operation on a directory, lstat

I'm developing a Laravel / Inertia application. So I was installing Laravel Breeze Starterkit following the procedure at https://laravel.com/docs/9.x/starter-kits#breeze-and-inertia in a Docker local installation (Docker Desktop)

I installer Vue frontend with sail artisan breeze:install vue

Now when I go for "npm install"

npm ERR! code EISDIR
npm ERR! syscall lstat
npm ERR! path \\wsl$\Ubuntu-20.04\home\magostoni\mycode\lv-vue-laracast\node_modules\.bin\acorn
npm ERR! errno -4068
npm ERR! EISDIR: illegal operation on a directory, lstat '\\wsl$\Ubuntu-20.04\home\magostoni\mycode\lv-vue-laracast\node
_modules\.bin\acorn'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Matteo\AppData\Local\npm-cache\_logs\2022-10-20T13_19_40_452Z-debug-0.log

NPM 8.19.2

Do you have any idea?

Kind regards, Matteo

Upvotes: 1

Views: 1162

Answers (1)

Jan F
Jan F

Reputation: 36

I had the same issue and ran npm commands on the wsl machine directly without prepending "sail" to npm install.

Steps to success:

Bring up the docker container using sail in detached mode (-d):

./vendor/bin/sail up -d

This way you can still execute commands.

So this throws the error you described:

npm install

This will run successfully:

sail npm install

Hope, that helps...

Upvotes: 2

Related Questions