Error: listen EACCES: permission denied 0.0.0.0:3000 at Server.setupListenHandle [as _listen2] (node:net:1723:21) at listenInCluster (node:net:1788:12) at Server.listen (node:net:1876:7) at module.exports.plugin (D:\hexo\shiguang-coding\blog\node_modules\.store\[email protected]\node_modules\browser-sync\dist\server\index.js:27:25) at Object.startServer [as fn] (D:\hexo\shiguang-coding\blog\node_modules\.store\[email protected]\node_modules\browser-sync\dist\async.js:180:52) at D:\hexo\shiguang-coding\blog\node_modules\.store\[email protected]\node_modules\browser-sync\dist\browser-sync.js:121:14 at iterate (D:\hexo\shiguang-coding\blog\node_modules\.store\[email protected]\node_modules\browser-sync\dist\utils.js:269:9) at D:\hexo\shiguang-coding\blog\node_modules\.store\[email protected]\node_modules\browser-sync\dist\utils.js:280:21 at executeTask (D:\hexo\shiguang-coding\blog\node_modules\.store\[email protected]\node_modules\browser-sync\dist\browser-sync.js:137:13) at Object.mergeMiddlewares [as fn] (D:\hexo\shiguang-coding\blog\node_modules\.store\[email protected]\node_modules\browser-sync\dist\async.js:169:9) at D:\hexo\shiguang-coding\blog\node_modules\.store\[email protected]\node_modules\browser-sync\dist\browser-sync.js:121:14 at iterate (D:\hexo\shiguang-coding\blog\node_modules\.store\[email protected]\node_modules\browser-sync\dist\utils.js:269:9) at D:\hexo\shiguang-coding\blog\node_modules\.store\[email protected]\node_modules\browser-sync\dist\utils.js:280:21 at executeTask (D:\hexo\shiguang-coding\blog\node_modules\.store\[email protected]\node_modules\browser-sync\dist\browser-sync.js:137:13) at Object.setFileWatchers [as fn] (D:\hexo\shiguang-coding\blog\node_modules\.store\[email protected]\node_modules\browser-sync\dist\async.js:158:9) at D:\hexo\shiguang-coding\blog\node_modules\.store\[email protected]\node_modules\browser-sync\dist\browser-sync.js:121:14 at iterate (D:\hexo\shiguang-coding\blog\node_modules\.store\[email protected]\node_modules\browser-sync\dist\utils.js:269:9) at D:\hexo\shiguang-coding\blog\node_modules\.store\[email protected]\node_modules\browser-sync\dist\utils.js:280:21 at executeTask (D:\hexo\shiguang-coding\blog\node_modules\.store\[email protected]\node_modules\browser-sync\dist\browser-sync.js:137:13) at Object.setInternalEvents [as fn] (D:\hexo\shiguang-coding\blog\node_modules\.store\[email protected]\node_modules\browser-sync\dist\async.js:151:9) at D:\hexo\shiguang-coding\blog\node_modules\.store\[email protected]\node_modules\browser-sync\dist\browser-sync.js:121:14 at iterate (D:\hexo\shiguang-coding\blog\node_modules\.store\[email protected]\node_modules\browser-sync\dist\utils.js:269:9) at D:\hexo\shiguang-coding\blog\node_modules\.store\[email protected]\node_modules\browser-sync\dist\utils.js:280:21 at executeTask (D:\hexo\shiguang-coding\blog\node_modules\.store\[email protected]\node_modules\browser-sync\dist\browser-sync.js:137:13) at Object.setOptions [as fn] (D:\hexo\shiguang-coding\blog\node_modules\.store\[email protected]\node_modules\browser-sync\dist\async.js:134:9) at D:\hexo\shiguang-coding\blog\node_modules\.store\[email protected]\node_modules\browser-sync\dist\browser-sync.js:121:14 at iterate (D:\hexo\shiguang-coding\blog\node_modules\.store\[email protected]\node_modules\browser-sync\dist\utils.js:269:9) at D:\hexo\shiguang-coding\blog\node_modules\.store\[email protected]\node_modules\browser-sync\dist\utils.js:280:21 Emitted 'error' event on Server instance at: at emitErrorNT (node:net:1767:8) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) { code: 'EACCES', errno: -4092, syscall: 'listen', address: '0.0.0.0', port: 3000 }
检查端口号是否被占用 ,发现并没有被占用
1
netstat -ano|findstr 3000
如果端口被占用,可以使用以下命令结束进程
1
taskkill -PID <PID> -F
我注意到映射的IP并非 127.0.0.1,而是 0.0.0.0,可能是网络地址转换异常
使用管理员权限重启下winnat服务
1 2 3 4 5
# 停止winnat服务 net stop winnat
# 开启winnat服务 net start winnat
winnat 是 Windows 操作系统中的一个命令行工具,用于配置和管理 Windows 网络地址转换(NAT)功能。NAT 是一种网络技术,允许一个网络地址空间(通常是私有网络)中的设备通过一个或多个公共 IP 地址与外部网络(如互联网)进行通信。