[英]Module not found : Can't resolve './App' in 'C:\Users\user\Desktop\react-challenge\sample\src'
I am learning react from a playlist and had created a basic app with create-react-app it was up and running without any issues initially.我正在从播放列表中学习反应,并使用 create-react-app 创建了一个基本应用程序,它最初启动并运行没有任何问题。 After I deleted some files in ' src ' and ' public ' ,the terminal is showing this error:
删除' src '和' public '中的一些文件后,终端显示此错误:
./src/index.js
Module not found: Can't resolve './App' in 'C:\Users\user\Desktop\react-challenge\sample\src'
I deleted everything except for 'index.html' in public and 'index.js' in src file.我删除了公共文件中的“index.html”和 src 文件中的“index.js”以外的所有内容。 I have attached the folder structure and index.js below.
我在下面附上了文件夹结构和 index.js。
EDIT: it was an issue regarding the files getting saved and reloading it is solved now.编辑:这是一个关于文件被保存和重新加载的问题,现在已经解决了。
It's fine to delete App.js if you're not using it, and it looks like you're not.如果你不使用它,删除 App.js 很好,看起来你没有。 You probably just need to restart your development server.
您可能只需要重新启动开发服务器。
Stop it with Ctrl + C用Ctrl + C停止它
Start it again with npm start
or yarn start
用
npm start
或yarn start
再次启动
power off your code editor and start again the code editor then run npm start in the terminal关闭代码编辑器并重新启动代码编辑器,然后在终端中运行 npm start
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.