react-native start error Invalid regular expression:
Posted zjhblogs
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了react-native start error Invalid regular expression:相关的知识,希望对你有一定的参考价值。
详细错误:
error Invalid regular expression: /(.*\__fixtures__\.*|node_modules[\]react[\]dist[\].*|website\node_modules\.*|heapCapture\bundle.js|.*\__tests__\.*)$)$/: Unterminated character class. Run CLI with --verbose flag for more details. SyntaxError: Invalid regular expression: /(.*\__fixtures__\.*|node_modules[\]react[\]dist[\].*|website\node_modules\.*|heapCapture\bundle.js|.*\__tests_s__\.*)$/: Unterminated character class at new RegExp (<anonymous>) at blacklist (D:WORKERmytestReactNativeAwesomeProject ode_modulesmetro-configsrcdefaultslacklist.js:34:10) at getBlacklistRE (D:WORKERmytestReactNativeAwesomeProject ode_modules@react-native-communitycliuild oolsloadMetroConfig.js:66:59) at getDefaultConfig (D:WORKERmytestReactNativeAwesomeProject ode_modules@react-native-communitycliuild oolsloadMetroConfig.js:82:20) at load (D:WORKERmytestReactNativeAwesomeProject ode_modules@react-native-communitycliuild oolsloadMetroConfig.js:118:25) at Object.runServer [as func] (D:WORKERmytestReactNativeAwesomeProject ode_modules@react-native-communitycliuildcommandsserver unServer.js:82:58) at Command.handleAction (D:WORKERmytestReactNativeAwesomeProject ode_modules@react-native-communitycliuildindex.js:164:23) at Command.listener (D:WORKERmytestReactNativeAwesomeProject ode_modulescommanderindex.js:315:8) at Command.emit (events.js:210:5) at Command.parseArgs (D:WORKERmytestReactNativeAwesomeProject ode_modulescommanderindex.js:651:12)
原因是:nodejs v12.11.0
最佳解决:降级到 v12.10 版本
参考文章:https://stackoverflow.com/questions/58120990/how-to-resolve-the-error-on-react-native-start
以上是关于react-native start error Invalid regular expression:的主要内容,如果未能解决你的问题,请参考以下文章
运行命令“npx react-native start”后出错
我运行了 react-native 链接领域,但仍然出现错误
[react-native]Getting Started for Android on Windows
[react-native]Getting Started for Android on Windows