no such file or directory .next/BUILD_ID

  1. 报错内容
% npm start

> pt-react@0.1.0 start
> next start

   ▲ Next.js 14.1.0
   - Local:        http://localhost:3000

Error: ENOENT: no such file or directory, open '/Users/alan/github/pt-react/.next/BUILD_ID'
    at async open (node:internal/fs/promises:633:25)
    at async Object.readFile (node:internal/fs/promises:1242:14)
    at async setupFsCheck (/Users/alan/github/pt-react/node_modules/next/dist/server/lib/router-utils/filesystem.js:145:19)
    at async initialize (/Users/alan/github/pt-react/node_modules/next/dist/server/lib/router-server.js:58:23)
    at async Server.<anonymous> (/Users/alan/github/pt-react/node_modules/next/dist/server/lib/start-server.js:246:36) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/Users/alan/github/pt-react/.next/BUILD_ID'
}
  1. 确认没有该目录文件
% ls -la
total 624
drwxr-xr-x   17 alan  staff     544  1 23 10:29 .
drwxr-xr-x   12 alan  staff     384  1 23 10:14 ..
-rw-r--r--    1 alan  staff      40  1 23 10:14 .eslintrc.json
drwxr-xr-x   12 alan  staff     384  1 23 10:17 .git
-rw-r--r--    1 alan  staff     391  1 23 10:14 .gitignore
-rw-r--r--    1 alan  staff    1383  1 23 10:14 README.md
-rw-r--r--    1 alan  staff     201  1 23 10:14 next-env.d.ts
-rw-r--r--    1 alan  staff      92  1 23 10:14 next.config.mjs
drwxr-xr-x  315 alan  staff   10080  1 23 10:29 node_modules
-rw-r--r--    1 alan  staff  158123  1 23 10:15 package-lock.json
-rw-r--r--    1 alan  staff     549  1 23 10:14 package.json
-rw-r--r--    1 alan  staff      83  1 23 10:14 postcss.config.js
drwxr-xr-x    4 alan  staff     128  1 23 10:14 public
drwxr-xr-x    3 alan  staff      96  1 23 10:14 src
-rw-r--r--    1 alan  staff     510  1 23 10:14 tailwind.config.ts
-rw-r--r--    1 alan  staff     578  1 23 10:14 tsconfig.json
-rw-r--r--    1 alan  staff  120822  1 23 10:29 yarn.lock
  1. 查看 README.md 文档,更改启动命令
% npm run dev

> pt-react@0.1.0 dev
> next dev

   ▲ Next.js 14.1.0
   - Local:        http://localhost:3000

 ✓ Ready in 4.3s
posted @   chenxinjie  阅读(571)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· SQL Server 2025 AI相关能力初探
· 展开说说关于C#中ORM框架的用法!
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
点击右上角即可分享
微信分享提示