我正在使用React Material UI,但出现此错误:找不到module:无法解析“@date-io/date-fns”。
这是我在 package.json 文件中的依赖项:
"dependencies": {
"@date-io/date-fns": "^2.0.0",
"@material-ui/core": "^4.9.5",
"@material-ui/pickers": "^3.2.10",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.5.0",
"@testing-library/user-event": "^7.2.1",
"axios": "^0.19.2",
"date-fns": "^2.0.0",
"react": "^16.13.0",
"react-dom": "^16.13.0",
"react-facebook-login": "^4.1.1",
"react-google-login": "^5.1.14",
"react-google-maps": "^9.4.5",
"react-hook-form": "^5.2.0",
"react-router": "^5.1.2",
"react-router-dom": "^5.1.2",
"react-scripts": "3.4.0"
},
我尝试安装最新版本的 date-io/date-fns,然后尝试了 2.0.0 版和 1.0.0 版,但仍然出现相同的错误。