Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error Cannot find module 'semver' in (npm run dev) command

im using laravel 8 and vuejs to create my website

i have this error after run npm run dev command:

Error: Cannot find module 'semver'
Require stack:
- /usr/share/npm/lib/utils/unsupported.js
- /usr/share/npm/bin/npm-cli.js
...

enter image description here

id tried this solutions:

sudo apt-get purge nodejs --auto-remove
sudo apt-get purge npm --auto-remove

sudo rm -rf /usr/local/bin/npm /usr/local/share/man/man1/node* ~/.npm
sudo rm -rf /usr/local/lib/node*
sudo rm -rf /usr/local/bin/node*
sudo rm -rf /usr/local/include/node*

sudo apt-get purge nodejs npm
sudo apt autoremove
npm i -g semver

and then installed again the nodejs and npm (latest version)

but the error still exist what should i do

like image 263
K1-Aria Avatar asked Dec 10 '25 18:12

K1-Aria


1 Answers

just try to install npm globally , it will install latest version of npm

 sudo npm install -g npm

it worked for me.

like image 150
sameraze agvvl Avatar answered Dec 12 '25 19:12

sameraze agvvl



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!