我试图添加一个日历,以反应移动应用程序使用react。我安装了yarn add react-calendar并启动了这个应用程序。然后app停止,这个错误出现了:
ERROR ReferenceError: Can't find variable: Intl
This error is located at:
in Day (created by TileGroup)
in div (created by Flex)
in Flex (created by TileGroup)
in TileGroup (created by Days)
in Days (created by MonthView)
in div (created by MonthView)
in div (created by MonthView)
in div (created by MonthView)
in MonthView (created by Calendar)
in div (created by Calendar)
in div (created by Calendar)
in Calendar (at Forecast.js:58)
in RCTView (at View.js:32)
in View (at Forecast.js:54)
in Forecast (at App.js:15)
in RCTView (at View.js:32)
in View (at App.js:13)
in App (at renderApplication.js:50)
in RCTView (at View.js:32)
in View (at AppContainer.js:92)
in RCTView (at View.js:32)
in View (at AppContainer.js:119)
in AppContainer (at renderApplication.js:43)
in weatherappmobil(RootComponent) (at renderApplication.js:60)Package.json依赖项如下:
"dependencies": {
"axios": "^0.27.2",
"react": "17.0.2",
"react-calendar": "^3.7.0",
"react-native": "0.68.2"
},
"devDependencies": {
"@babel/core": "^7.18.6",
"@babel/runtime": "^7.18.6",
"@react-native-community/eslint-config": "^3.0.3",
"babel-jest": "^28.1.1",
"eslint": "^8.18.0",
"jest": "^28.1.1",
"metro-react-native-babel-preset": "^0.71.2",
"react-test-renderer": "17.0.2"
}任何帮助都是非常感谢的。
发布于 2022-06-29 11:48:49
whatever).
$ cd # into the directory of your project where
# package.json is located
# Now we remove node_modules, because it's a reversible operation
$ rm -rf node_modules
# Now we remove yarn.lock and package-lock.json.
# this step is not reversible
$ rm yarn.lock package-lock.json
# Now we reinstall all the dependencies
$ yarn老实说,这样做偶尔会解决很多问题。你应该记住这个程序,因为我做了很多次。
https://stackoverflow.com/questions/72791059
复制相似问题