Module not found: Error: Can't resolve 'redux-thunk' in 'C:\Users\烟火阑珊倚人间\bookstore-admin\src' ERROR in ./src/App.js 51:42-50 export 'Redirect' (imported as 'Redirect') was not found in 'react-router-dom' (possible exports: AbortedDeferredError, Await, BrowserRouter, Form, HashRouter, Link, MemoryRouter, NavLink, Navigate, NavigationType, Outlet, Route, Router, RouterProvider, Routes, ScrollRestoration, UNSAFE_DataRouterContext, UNSAFE_DataRouterStateContext, UNSAFE_LocationContext, UNSAFE_NavigationContext, UNSAFE_RouteContext, UNSAFE_useRouteId, UNSAFE_useScrollRestoration, createBrowserRouter, createHashRouter, createMemoryRouter, createPath, createRoutesFromChildren, createRoutesFromElements, createSearchParams, defer, generatePath, isRouteErrorResponse, json, matchPath, matchRoutes, parsePath, redirect, renderMatches, resolvePath, unstable_HistoryRouter, unstable_useBlocker, unstable_usePrompt, useActionData, useAsyncError, useAsyncValue, useBeforeUnload, useFetcher, useFetchers, useFormAction, useHref, useInRouterContext, useLinkClickHandler, useLoaderData, useLocation, useMatch, useMatches, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRouteError, useRouteLoaderData, useRoutes, useSearchParams, useSubmit) ERROR in ./src/App.js 66:41-47 export 'Switch' (imported as 'Switch') was not found in 'react-router-dom' (possible exports: AbortedDeferredError, Await, BrowserRouter, Form, HashRouter, Link, MemoryRouter, NavLink, Navigate, NavigationType, Outlet, Route, Router, RouterProvider, Routes, ScrollRestoration, UNSAFE_DataRouterContext, UNSAFE_DataRouterStateContext, UNSAFE_LocationContext, UNSAFE_NavigationContext, UNSAFE_RouteContext, UNSAFE_useRouteId, UNSAFE_useScrollRestoration, createBrowserRouter, createHashRouter, createMemoryRouter, createPath, createRoutesFromChildren, createRoutesFromElements, createSearchParams, defer, generatePath, isRouteErrorResponse, json, matchPath, matchRoutes, parsePath, redirect, renderMatches, resolvePath, unstable_HistoryRouter, unstable_useBlocker, unstable_usePrompt, useActionData, useAsyncError, useAsyncValue, useBeforeUnload, useFetcher, useFetchers, useFormAction, useHref, useInRouterContext, useLinkClickHandler, useLoaderData, useLocation, useMatch, useMatches, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRouteError, useRouteLoaderData, useRoutes, useSearchParams, useSubmit)
时间: 2023-10-04 10:04:11 浏览: 206
根据你提供的错误信息,看起来你的代码中引入的依赖库 'redux-thunk' 和 'react-router-dom' 无法找到。请确保你已经正确安装了这两个库,并且在你的代码中正确引入了它们。你可以通过运行以下命令来安装这些库:
```
npm install redux-thunk react-router-dom
```
另外,请确保你已经在代码中正确引入了 'Redirect' 和 'Switch' 组件,以便在 'react-router-dom' 中使用它们。例如:
```javascript
import { Redirect, Switch } from 'react-router-dom';
```
如果问题仍然存在,请检查你的代码和文件路径是否正确,以及确保这些库版本与你的项目兼容。希望能帮到你!如果还有其他问题,请随时提问。
相关问题
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!
Module not found: Error: Can t resolve element-ui in
根据提供的引用内容,报错信息是"Module not found: Error: Can't resolve 'element-ui' in"。这个错误通常表示在项目中找不到名为'element-ui'的模块。这可能是由于以下几个原因导致的:
1. 模块未安装:确保已经使用npm或yarn等包管理工具正确安装了'element-ui'模块。可以通过运行以下命令来安装它:
```shell
npm install element-ui
```
2. 模块路径错误:检查引入'element-ui'模块的路径是否正确。确保路径与实际的模块位置相匹配。如果模块在项目的node_modules目录下,则可以直接引入,如下所示:
```javascript
import ElementUI from 'element-ui';
```
3. webpack配置错误:如果你正在使用webpack打包工具,确保在webpack配置文件中正确配置了'element-ui'模块的解析。可以在webpack配置文件中添加以下代码:
```javascript
resolve: {
alias: {
'element-ui': 'element-ui/lib/index.js'
}
}
```
请检查上述原因并尝试解决问题。如果问题仍然存在,请提供更多的上下文信息以便我能够更好地帮助你。
阅读全文