Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Drinu89's avatar

npm run dev is giving me Error: ENOSPC: System limit for number of file watchers reached, watch '/var/www/laravel/vendor...

Hi I installed a new laravel 9 project and installed the laravel/ui package. I followed the instructions and installed executed the following commands

1 - composer require laravel/ui

2 - php artisan ui vue --auth

3 - npm install

4 - npm run dev (Gives me Error: ENOSPC)

When executing the last command npm run dev it gives me a lot of errors regarding: System limit for number of file watchers reached, watch '/var/www/laravel/vendor...

Can somebody help me with this issue?

0 likes
8 replies
CamKem's avatar

Did you do the following:

1: Change directory to your sites directory (cd ~/Sites/)

2: Create laravel project (composer create-project laravel/laravel projectname)

3: Change directory to the project you just created (cd projectname)

4: Set up your database details in the .env file (generally mySQL or sqlite)

5: Start your server (php artisan serve)

6: Install a frontend starter pack if you want UI eg Breeze (composer require laravel/breeze --dev)

7: Choose a scaffold (example blade) to install and run the install commands:

7.1 php artisan breeze:install

7.2 php artisan migrate

7.3 npm install

7.4 npm run dev

This is way to boot up a new project in laravel 9. However you can stop at step 4 and build your own views.

Drinu89's avatar

@CamKem I will try this out and check if the same error pop's up. Thanks for now

Drinu89's avatar

Sooo Sorry for writing here again but I tought that I executed the npm run dev and unfortunately I did not... After I followed all of your steps and tried to execute npm run dev after I executed npm install the error : Error: ENOSPC: System limit for number of file watchers reached, watch '/var/www/laravel/vendor... still occured

Drinu89's avatar
Drinu89
OP
Best Answer
Level 1

npm run dev was not required for me but npm run build works and helped me.

1 like
Gifted's avatar

On your terminal do this either you are windows use bash terminal but am answering for Linux to be specific

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

5 likes

Please or to participate in this conversation.