昨天發生了一個錯誤,那就是啓動的指令很可能是錯誤的,我自己起專案的指令是 npm run dev
然後,起起來會是這樣子的
先來說,啓動時可能會遇到的錯誤
npm error code ENOENT
npm error syscall open
npm error path D:\imac\openlovable_react\package.json
npm error errno -4058
npm error enoent Could not read package.json: Error: ENOENT: no such file or directory, open 'D:\imac\openlovable_react\package.json'
npm error enoent This is related to npm not being able to find a file.
npm error enoent
npm error A complete log of this run can be found in: C:\Users\AppData\Local\npm-cache\_logs\2025-10-04T18_22_33_588Z-debug-0.log
這個可能會是clone下來沒有切路徑而出現錯誤,所以從github clone下來的專案記得要切路徑喲~
(venv) PS C:open-lovable> npm start`
> open-lovable@0.1.0 start
next start
▲ Next.js 15.4.3
- Local: [http://localhost:3000](http://localhost:3000/)
- Network: [http://0.0.0.0:3000](http://172.23.240.1:3000/)
✓ Starting...
[Error: Could not find a production build in the '.next' directory. Try building your app with 'next build' before starting the production server. https://nextjs.org/docs/messages/production-start-no-build-id]
Error的部分意思是你執行的是 next start
(生產模式),但還沒先執行 next build
來生成 .next
資料夾。
但是,也有可能會是指令不一樣的差別那我是輸入 npm run dev
來啓動試試看
然後就可以點擊 http://localhost:3000 就可以開啓自己成功加進去以及建立起來的專案啦
輸入你想克隆的網址,比較需要注意的是AI模型的地方,假如你.env
檔的AI api key是跟我一樣只有gemini API key 的話那就記得要改成 Gemini 模型哦
那我所輸入的網址是在網上隨便找的一個旅游網址
這是克隆后的頁面
而Open-Lovable 主要基于 React 框架进行开发,同时能够生成标准的 React 应用项目结构,并深度结合 Tailwind CSS 来快速生成现代化前端页面。
对于更高级的项目,Open-Lovable 也支持输出兼容 Next.js 的 React 代码(尤其适合那些需要服务端渲染或路由等 Next.js 特性的项目),但默认以纯 React 组件为主,并未强绑定 Next.js。
综合来看,Open-Lovable 的定位是生成标准 React 应用,部分功能可兼容 Next.js,用于满足开发者在主流现代前端框架下的多场景需求。
提及:我所貼的網址是 https://traveling.com/en/