You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.13 18:10:28