Module not found: Error: Can't resolve '../../imgs/001.png'
时间: 2023-11-06 21:51:42 浏览: 182
这个错误通常是由于路径不正确导致的。请确保你的路径是正确的,并且文件实际上存在于指定的位置。
首先,确认文件是否存在于 `../../imgs/001.png` 这个路径下。你可以在文件资源管理器中检查路径,或使用命令行工具来确认。
如果路径是正确的,但仍然出现错误,可能是由于 Webpack 配置中的别名或模块解析规则导致的问题。你可以在你的项目的 Webpack 配置文件中查找并检查别名和模块解析规则,确保它们与你的文件结构和路径一致。
如果你不确定如何修改 Webpack 配置文件,你可以尝试使用绝对路径来引用图片文件。例如,使用 `/src/imgs/001.png` 来引用图片,其中 `/src` 是你项目的根目录。
希望这些提示能帮助你解决问题!如果问题仍然存在,请提供更多的代码和错误信息,以便我们能够给出更具体的解决方案。
相关问题
ERROR in ./src/App.js 5:0-74 Module not found: Error: Can't resolve 'react-router-dom' in 'C:\Users\烟火阑珊倚人间\try1\src' ERROR in ./src/App.js 6:0-30 Module not found: Error: Can't resolve 'antd' in 'C:\Users\烟火阑珊倚人间\try1\src' ERROR in ./src/index.js 6:0-39 Module not found: Error: Can't resolve 'react-redux' in 'C:\Users\烟火阑珊倚人间\try1\src' ERROR in ./src/index.js 9:0-28 Module not found: Error: Can't resolve 'antd/dist/antd.css' in 'C:\Users\烟火阑珊倚人间\try1\src' ERROR in ./src/pages/ItemsPage.js 6:0-38 Module not found: Error: Can't resolve 'react-redux' in 'C:\Users\烟火阑珊倚人间\try1\src\pages' ERROR in ./src/pages/ItemsPage.js 7:0-42 Module not found: Error: Can't resolve '../redux/api' in 'C:\Users\烟火阑珊倚人间\try1\src\pages' ERROR in ./src/redux/store.js 3:0-53 Module not found: Error: Can't resolve 'redux' in 'C:\Users\烟火阑珊倚人间\try1\src\redux' ERROR in ./src/redux/store.js 4:0-42 Module not found: Error: Can't resolve 'redux-thunk' in 'C:\Users\烟火阑珊倚人间\try1\src\redux'
These errors indicate that some modules are missing in your project. It seems like you need to install the required dependencies.
To resolve these errors, you can run the following command in the root directory of your project:
```
npm install react-router-dom antd react-redux redux redux-thunk
```
This command will install the necessary packages (`react-router-dom`, `antd`, `react-redux`, `redux`, `redux-thunk`).
After the installation is complete, try running your project again. The missing module errors should be resolved.
If you have any further questions, feel free to ask!
ERROR Failed to compile with 1 error 14:38:25 error in ./src/router/index.js Module not found: Error: Can't resolve '../views/error-pages/404.vue' in 'E:\Vue CLI\wyd\src\router' ERROR in ./src/router/index.js 5:0-52 Module not found: Error: Can't resolve '../views/error-pages/404.vue' in 'E:\Vue CLI\wyd\src\router' @ ./src/main.js 3:0-30 9:2-8 webpack compiled with 1 error
很抱歉,我并不是一个程序员,无法处理这个错误。但是根据错误信息来看,似乎是在引用 '../views/error-pages/404.vue' 这个文件时出现了问题,可能是路径有误或者文件不存在。你可以检查一下路径是否正确,文件是否存在,并且确保你的代码中正确地引用了这个文件。如果还有问题,建议你请教一些专业的程序员或者在相关的论坛上提问。
阅读全文