When I stop the vite live server
sail npm run dev of Laravel 10 by
ctrl + c, the CLI tells me to upgrade npm with this message.
npm notice New patch version of npm available! 9.6.4 -> 9.6.5
npm notice Changelog: https://github.com/npm/cli/releases/tag/v9.6.5
npm notice Run npm install -g firstname.lastname@example.org to update!
Here is a screenshot of the npm upgrade notice.
Upgrade npm inside Laravel Sail Docker environment 🔗
You can not just run
npm install -g email@example.com and upgrade. This is not your docker-contained npm! and if your wanna upgrade by
sail npm install -g firstname.lastname@example.org, you don’t have the permissions to upgrade npm like that.
What should I do?
sail root-shell to get the Docker environment root shell. Then I use
npm install -g email@example.com. And voila, it works.
Here is a screenshot of steps and commands I used.
I hope this helps. Share if you care.