Next.js运行npm run dev时锁占用错误的解决求助
Next.js运行npm run dev时锁占用错误的解决求助
各位大佬,求助!我在运行npm run dev启动Next.js服务器的时候,碰到了锁占用的错误,具体报错信息如下:
Unable to acquire lock at "filepath", is another instance of next dev running? Suggestion: If you intended to restart next dev, terminate the other process, and then try again.
我已经试了好几种方法,但都没搞定:
- 用
netstat -ano | findstr LISTENING命令查看监听的端口,确实看到有不少,但执行taskkill /IM node.exe /F强制杀死node进程时,过了一会儿就弹出错误:ERROR: This operation returned because the timeout period expired. - 手动删除了.next文件夹,没用
- 换端口启动项目:
npx next dev -p 3001,还是报同样的锁错误 - 再次尝试强制杀死node进程:
taskkill /F /IM node.exe,依然没效果 - 用kill-port工具清理3001端口:
npx kill-port 3001,问题依旧
备注:内容来源于stack exchange,提问作者Lena Shihab
相关产品推荐
相关产品推荐

