运行 npm run dev 命令时,出现以下错误

 ERROR  error when starting dev server:                                                                                                                                                                                   10:48:45
Error: listen EACCES: permission denied 0.0.0.0:3100
    at Server.setupListenHandle [as _listen2] (node:net:1734:21)
    at listenInCluster (node:net:1799:12)
    at Server.listen (node:net:1887:7)
    at httpServer.listen (file:///E:/dxdigital/jeecg/v3.6.0/jeecgboot-vue3/node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:65338:20)

解决方法

1.确认是否有程序占用该端口

netstat -ano | findstr 3100

2.使用管理员权限运行

net stop winnat

net start winnat