简体   繁体   English

将应用程序部署到 Netlify:找不到模块:错误:无法解析 '/opt/build/repo/src' 中的 './pages/HomePage'

[英]React app deployment to Netlify : Module not found: Error: Can't resolve './pages/HomePage' in '/opt/build/repo/src'

部署错误

How can I solve this error?我该如何解决这个错误?

I tried many approaches like using Netlify CLI, linking to git and github but nothing worked.我尝试了许多方法,例如使用 Netlify CLI,链接到 git 和 github 但没有任何效果。

The app works fine in development mode with no errors but it shows Error:404 page not found on both Netlify and Github Pages该应用程序在开发模式下运行良好,没有错误,但在 Netlify 和 Github 页面上都找不到错误:404 页面

已部署应用的链接

What should I do?我应该怎么办?

I found the solution, I changed the folders' names and pushed them into Github but Github didn't change the folders' names, and Netlify is case-sensitive towards nomenclature.我找到了解决方案,我更改了文件夹的名称并将它们推送到 Github 但 Github 没有更改文件夹的名称,并且 Netlify 对命名法区分大小写。

Check your directory names using gitbash terminal, as it works like a linux Netlify/Vercel are linux containers check the actual case using gitbash and fix the name as per the import使用gitbash终端检查您的目录名称,因为它的工作方式类似于 linux Netlify/Vercel 是 linux 容器使用 gitbash 检查实际情况并根据导入修复名称在此处输入图像描述

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 找不到模块:错误:无法解析“/opt/build/repo/src”中的“./components/Scrolltotop” - Module not found: Error: Can't resolve './components/Scrolltotop' in '/opt/build/repo/src' 找不到模块:错误:无法解析“/opt/build/repo/src”中的“./components/layouts/Navbar” - Module not found: Error: Can't resolve './components/layouts/Navbar' in '/opt/build/repo/src' Gatsby Netlify 构建错误:无法解析“/opt/build/repo/src/templates”中的“../components/GridTemplate/GridTemplate.js” - Gatsby Netlify build error: Can't resolve '../components/GridTemplate/GridTemplate.js' in '/opt/build/repo/src/templates' 在 .netlify 上部署我的 React 项目时显示错误:无法在 '/opt/build/repo/src/components/header' 中解析 '../../assets/CV.pdf' - while deploying my react project on netlify showing error: Can't resolve '../../assets/CV.pdf' in '/opt/build/repo/src/components/header' Netlify 部署,找不到模块:错误:无法解析“react-icons/SI” - Netlify Deployment , Module not found: Error: Can't resolve 'react-icons/SI' 反应图标的导入错误。 找不到模块:无法解析“/usr/src/app/src/...”中的“react-icons/io” - Import error for react-icons. Module not found: Can't resolve 'react-icons/io' in '/usr/src/app/src/...' 反应:找不到模块:无法解析“/usr/src/app/src”中的“react-router-dom” - React: Module not found: Can't resolve 'react-router-dom' in '/usr/src/app/src' 找不到模块:错误:无法解析“/tmp/build_67d6d8dd/src”中的“react-google-recaptcha” - Module not found: Error: Can't resolve 'react-google-recaptcha' in '/tmp/build_67d6d8dd/src' 放大 React 构建失败,显示“未找到模块:错误:无法解析‘/codebuild/output/src313005886/src/client-portal/src’中的‘./components/...’” - Amplify React build fail with "Module not found: Error: Can't resolve './components/...' in '/codebuild/output/src313005886/src/client-portal/src' " Netlify 'build.command failed: base: /opt/build/repo/client' 用于部署 React 应用程序 - Netlify 'build.command failed: base: /opt/build/repo/client' for deploying React app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM