react-native - 无法从 `node_modules\@jest\console\build\BufferedConsole.js` 解析模块 `assert`:在项目中找不到断言
问题描述
我开始在我工作的 react-native 应用程序上突然出现这个错误。我已经尝试了所有可能的解决方案来解决其他问题,比如清除缓存,但几乎没有对我有用。
即使我尝试运行我以前的工作应用程序并创建新应用程序,但所有人都遇到了同样的错误。
如果您需要任何进一步的细节来调查这个问题,请告诉我。任何形式的帮助将不胜感激。
提前致谢。
下面是我的 package.json
{
"name": "MyApp",
"version": "0.0.1",
"private": true,
"rnpm": {
"assets": [
"./assets/fonts"
]
},
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint .",
"clean": "react-native-clean-project"
},
"dependencies": {
"@react-native-community/masked-view": "^0.1.10",
"@react-navigation/bottom-tabs": "^5.9.1",
"@react-navigation/drawer": "^5.9.2",
"@react-navigation/material-bottom-tabs": "^5.2.18",
"@react-navigation/native": "^5.7.5",
"@react-navigation/stack": "^5.9.2",
"react": "16.13.1",
"react-native": "0.63.2",
"react-native-clean-project": "^3.4.0",
"react-native-gesture-handler": "^1.8.0",
"react-native-reanimated": "^1.13.1",
"react-native-safe-area-context": "^3.1.8",
"react-native-screens": "^2.11.0",
"react-native-splash-screen": "^3.2.0",
"react-native-tab-view": "^2.15.1",
"react-native-vector-icons": "^7.1.0",
"react-native-webview": "^10.9.0"
},
"devDependencies": {
"@babel/core": "^7.8.4",
"@babel/runtime": "^7.8.4",
"@react-native-community/eslint-config": "^1.1.0",
"babel-jest": "^25.1.0",
"eslint": "^6.5.1",
"jest": "^25.1.0",
"metro-react-native-babel-preset": "^0.59.0",
"react-test-renderer": "16.13.1"
},
"jest": {
"preset": "react-native"
}
}
解决方案
推荐阅读
- r - 多次运行 catboost 后出现“C 堆栈使用 [高数] 太接近限制”
- java - 你好!我的项目中有一个错误。我不知道为什么 Logcat 对我的改造对象发誓
- c++ - 如何传递向量
>v[] - node.js - nodejs 应用程序在本地运行良好,但不能在线运行
- ubuntu - 从终端启动的 vscode 无法从其终端打开脚本或图形应用程序
- javascript - 在 JavaScript 中访问 Map 对象内的对象和数组
- c# - VS 在使用通用 Blazor 视图的错误列表中显示错误的问题
- spring - 我们可以对 Pig UDF 进行 bean 注入吗
- javascript - 如何在 Javascript/HTML 中存储输入值
- git - 如果我在没有设置用户名和电子邮件地址的情况下进行第一次推送会发生什么?