Error: listen EACCES: permission denied xxx的解决方案

最近在启动Tauri项目的时候报错

1
2
3
4
5
6
7
8
9
10
error when starting dev server:
Error: listen EACCES: permission denied ::1:1420
at Server.setupListenHandle [as _listen2] (node:net:1855:21)
at listenInCluster (node:net:1920:12)
at GetAddrInfoReqWrap.doListen [as callback] (node:net:2069:7)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:109:8)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Error The "beforeDevCommand" terminated with a non-zero status code.
error Command failed with exit code 1.

解决方案

然后网上说是端口被占用了,但我查看后发现并没有,最后其实解决方法很简单,重启网卡就行了

首先用管理员身份打开powershell

输入

1
2
3
net stop winnat

net start winnat