尝试运行react-native run-ios,但出现以下错误:
@babel/core/lib/config/validation/options.js:97
throw new ReferenceError(unknownOptErr);
^
ReferenceError: Unknown option: .configFile. Check out http://babeljs.io/docs/usage/options/ for more information about options.
at buildUnknownError (/Users/glenbeamson/Documents/Repos/Projects/ReactNative/RO2018fs/client/node_modules/@babel/core/lib/config/validation/options.js:97:11)
at /Users/glenbeamson/Documents/Repos/Projects/ReactNative/RO2018fs/client/node_modules/@babel/core/lib/config/validation/options.js:83:57
at Array.forEach (<anonymous>)
at validate (/Users/glenbeamson/Documents/Repos/Projects/ReactNative/RO2018fs/client/node_modules/@babel/core/lib/config/validation/options.js:61:21)
at loadConfig (/Users/glenbeamson/Documents/Repos/Projects/ReactNative/RO2018fs/client/node_modules/@babel/core/lib/config/index.js:37:48)
at loadOptions (/Users/glenbeamson/Documents/Repos/Projects/ReactNative/RO2018fs/client/node_modules/@babel/core/lib/index.js:72:36)
at OptionManager.init (/Users/glenbeamson/Documents/Repos/Projects/ReactNative/RO2018fs/client/node_modules/@babel/core/lib/index.js:82:12)
at compile (/Users/glenbeamson/Documents/Repos/Projects/ReactNative/RO2018fs/client/node_modules/@babel/register/lib/node.js:61:42)
at compileHook (/Users/glenbeamson/Documents/Repos/Projects/ReactNative/RO2018fs/client/node_modules/@babel/register/lib/node.js:102:12)
at Module._compile (/Users/glenbeamson/Documents/Repos/Projects/ReactNative/RO2018fs/client/node_modules/pirates/lib/index.js:77:29)
已经尝试再次npm install --save react @babel/core @babel/cli
以尝试清除所有内容,还尝试了npm cache verify
,但无济于事。有人可以发现我在做什么错吗?
package.json在这里
{
"name": "client",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"@babel/cli": "^7.1.2",
"@babel/core": "^7.0.0-beta.38",
"babel": "^6.23.0",
"react": "^16.6.0-alpha.f47a958",
"react-native": "0.57.3",
"react-native-reanimated": "^1.0.0-alpha.10",
"react-native-vector-icons": "^6.0.2",
"react-navigation": "^3.0.0-alpha.6"
},
"devDependencies": {
"@babel/plugin-external-helpers": "^7.0.0",
"babel-jest": "23.6.0",
"jest": "23.6.0",
"metro-react-native-babel-preset": "0.48.1",
"react-test-renderer": "16.6.0-alpha.8af6728"
},
"jest": {
"preset": "react-native"
}
}
答案 0 :(得分:0)
尝试删除您的node_modules
文件夹,清理其cache
,然后重新安装npm
或yarn
,它最终会工作。