Home > Back-end >  error when starting dev server npm run dev
error when starting dev server npm run dev

Time:07-04

so i was tinkering with laravel and i tried to install bootstrap. as soon as i need to type npm install && npm run dev, the install part goes with no hiccups. only when the run dev command this error shows up.

C:\Users\Enduser\Documents\laravel projects\sampleblog>npm run dev npm WARN config global --global, --local are deprecated. Use --location=global instead.

dev vite

error when starting dev server:

Error: listen EACCES: permission denied 127.0.0.1:3000

at Server.setupListenHandle [as _listen2] (node:net:1355:21)
at listenInCluster (node:net:1420:12)
at doListen (node:net:1559:7)
at processTicksAndRejections (node:internal/process/task_queues:84:21)

any ideas on why this is happening? thanks for the help.

CodePudding user response:

Go to folder C:\Program Files\nodejs

Open the file npm, npm.cmd, npx, npx.cmd in a text editor

Replace prefix -g with prefix --location=global

and try again with the same command.

npm run dev

Hope this will resolve your issue.

CodePudding user response:

In case you're using Laravel 9, Vite is the default tool for bundling assets. You may want to roll back to webpack.mix by changing

"development": "vite"

to

"development": "mix"

in package.json, script section.

or in case of diving into this new feature, you can check Laravel documentation, here.

  • Related