Simple JS developer productivity tip: Fail npm start if the expected port...


Simple JS developer productivity tip:

Fail npm start if the expected port isn’t available.

Here’s why: If the port isn’t available, the app is probably running already in another terminal.

So I might not notice and look at localhost:3000 when my new instance started on 3001. Result? I may waste time wondering why my changes aren’t being reflected.

Always starting on the same port resolves this issue.

Example: With Vite, set —strictPort

View original on X