首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ReferenceError:找不到变量: Intl时,尝试反应-日历

ReferenceError:找不到变量: Intl时,尝试反应-日历
EN

Stack Overflow用户
提问于 2022-06-28 17:50:36
回答 1查看 179关注 0票数 0

我试图添加一个日历,以反应移动应用程序使用react。我安装了yarn add react-calendar并启动了这个应用程序。然后app停止,这个错误出现了:

代码语言:javascript
复制
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依赖项如下:

代码语言:javascript
复制
"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"
  }

任何帮助都是非常感谢的。

EN

回答 1

Stack Overflow用户

发布于 2022-06-29 11:48:49

whatever).

  • Open

  • 关闭IDE,停止项目,基本上关闭计算机上现在不需要的应用程序(浏览器、Spotify、终端)。执行以下操作:

代码语言:javascript
复制
$ 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

  1. 开始开发和使用您想要的计算机。

老实说,这样做偶尔会解决很多问题。你应该记住这个程序,因为我做了很多次。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72791059

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档