错误:当尝试从文件C:\Users\byambadorj\Desktop\LoginEx\src\LoginScreen.js
解析模块native-base
时,成功找到了包C:\Users\byambadorj\Desktop\LoginEx\node_modules\native-base\package.json
。但是,此包本身指定了无法解析的main
模块字段(C:\Users\byambadorj\Desktop\LoginEx\node_modules\native-base\src\index
。实际上,这些文件都不存在C:\Users\byambadorj\Desktop\LoginEx\node_modules\native-base\src\index(.native|.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)
- C:\Users\byambadorj\Desktop\LoginEx\node_modules\native-base\src\index\index(.native|.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)at DependencyGraph.resolveDependency(C:\Users\byambadorj\Desktop\LoginEx\node_modules\metro\src\node-hast\DependencyGraph.js:311:17)......
这是我的package.json
{
"name": "LoginEx",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"@react-navigation/native": "^6.0.6",
"native-base": "^3.2.2",
"react": "17.0.2",
"react-native": "0.66.4",
"react-native-safe-area-context": "^3.3.2",
"react-native-screens": "^3.10.1",
"react-native-size-matters": "^0.4.0"
},
"devDependencies": {
"@babel/core": "7.16.7",
"@babel/runtime": "7.16.7",
"@react-native-community/eslint-config": "2.0.0",
"babel-jest": "26.6.3",
"eslint": "7.14.0",
"jest": "26.6.3",
"metro-react-native-babel-preset": "0.66.2",
"react-test-renderer": "17.0.2"
},
"jest": {
"preset": "react-native"
}
}
2条答案
按热度按时间oknrviil1#
尝试停止地铁和重新启动它清除缓存。
dojqjjoe2#
尝试停止地铁和重新启动它清除缓存
如果你使用的是mac,它将无法工作.尝试在mac上