关闭后,为什么可以启动React应用程序?

发布于 2025-01-17 14:13:01 字数 2142 浏览 0 评论 0 原文

与React完整的新手,似乎比我经历的任何事情都更加令人费解。编码比JavaScript更容易。另一方面,运行应用程序...一场完整的噩梦...

刚刚遵循YouTube上的教程,实际上设法完成了它,而不会在中途遇到。但是3小时后,当我想再次检查该项目时。 (只想在浏览器中运行该应用并查看)我转到VS代码,开放终端并输入NPM启动(NewB So IDK So Ethith Ithing,这甚至我应该做什么吗?)它给了我这个

“下一步启动

就绪 - 在0.0.0.0.0:3000上启动服务器,URL:http:// localhost:3000 信息 - 使用webpack 5。原因:no next.config.js https://nextjs.org/docs/消息/webpack5 错误:找不到在'c:\ users \ eric \ downloads \ new文件夹\ portfolio_website-starter.next'Directory中找到的生产构建。在启动生产服务器之前,请尝试使用“下一个构建”构建应用程序。 在server.readbuildid(c:\ users \ eric \ downloads \ new文件夹\ portfolio_website-starter \ node_modules \ next \ next \ dist \ dist \ sext-server \ server \ server \ server \ next-server.js:151:355) 在新服务器(c:\ users \ eric \ downloads \ new文件夹\ portfolio_website-starter \ node_modules \ next \ next \ dist \ dist \ dist \ sext-server \ server \ server \ server \ next-server.js:3:120) 在sextserver.createserver(c:\ users \ eric \ downloads \ new文件夹\ portfolio_website-starter \ node_modules \ next \ next \ dist \ dist \ server \ next.js:1:2935) 在async c:\ users \ eric \ downloads \ new文件夹\ portfolio_website-starter \ node_modules \ next \ next \ dist \ dist \ server \ server \ next.js:1:3360 npm err!代码elifecycle npm err! Errno 1 npm err! npm err!退出状态1 npm err! npm err!在 [emagy  protected startection in __ href =“/cdn-cgi/l/email-protection” class =“ __ cf_email__” npm err!这可能不是NPM的问题。上面可能还有其他日志记录输出。

npm err!可以在以下方式中找到此运行的完整日志 npm err! c:\ users \ eric \ appdata \ roaming \ npm-cache_logs \ 2022-03-28T02_41_25_25_297Z-debug.log.log“

我什至无法开始对所有这些都破裂。 ,这始终是完整的文字墙...有人可以解释发生了什么吗?

Complete newbie with React, and it seems so much more convoluted than anything i've experienced. the coding is easier than JavaScript. running the applications on the other hand... a complete nightmare...

Just followed a tutorial on youtube and actually managed to finish it without bugging out mid way. But 3 hours later, when I wanted to check out the project again. (just want to run the app in my browser and have a look) I go to vs code and open terminal and type in npm start (newb so idk anything, is this even what i should do? ) and it gives me this

"next start

ready - started server on 0.0.0.0:3000, url: http://localhost:3000
info - Using webpack 5. Reason: no next.config.js https://nextjs.org/docs/messages/webpack5
Error: Could not find a production build in the 'C:\Users\Eric\Downloads\New folder\portfolio_website-STARTER.next' directory. Try building your app with 'next build' before starting the production server. https://nextjs.org/docs/messages/production-start-no-build-id
at Server.readBuildId (C:\Users\Eric\Downloads\New folder\portfolio_website-STARTER\node_modules\next\dist\next-server\server\next-server.js:151:355)
at new Server (C:\Users\Eric\Downloads\New folder\portfolio_website-STARTER\node_modules\next\dist\next-server\server\next-server.js:3:120)
at NextServer.createServer (C:\Users\Eric\Downloads\New folder\portfolio_website-STARTER\node_modules\next\dist\server\next.js:1:2935)
at async C:\Users\Eric\Downloads\New folder\portfolio_website-STARTER\node_modules\next\dist\server\next.js:1:3360
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: next start
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Eric\AppData\Roaming\npm-cache_logs\2022-03-28T02_41_25_297Z-debug.log"

I can't even begin to decipher with all that was. this is why i'm having so much trouble with React, it's always a complete wall of text... can someone please explain what's going on?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文