码迷,mamicode.com
首页 > 其他好文 > 详细

react-native start error Invalid regular expression:

时间:2019-11-20 12:34:09      阅读:270      评论:0      收藏:0      [点我收藏+]

标签:mep   href   ESS   blacklist   worker   module   action   原因   rbo   

详细错误:

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:\WORKER\mytest\ReactNative\AwesomeProject\node_modules\metro-config\src\defaults\blacklist.js:34:10)
    at getBlacklistRE (D:\WORKER\mytest\ReactNative\AwesomeProject\node_modules\@react-native-community\cli\build\tools\loadMetroConfig.js:66:59)
    at getDefaultConfig (D:\WORKER\mytest\ReactNative\AwesomeProject\node_modules\@react-native-community\cli\build\tools\loadMetroConfig.js:82:20)
    at load (D:\WORKER\mytest\ReactNative\AwesomeProject\node_modules\@react-native-community\cli\build\tools\loadMetroConfig.js:118:25)
    at Object.runServer [as func] (D:\WORKER\mytest\ReactNative\AwesomeProject\node_modules\@react-native-community\cli\build\commands\server\runServer.js:82:58)    
    at Command.handleAction (D:\WORKER\mytest\ReactNative\AwesomeProject\node_modules\@react-native-community\cli\build\index.js:164:23)
    at Command.listener (D:\WORKER\mytest\ReactNative\AwesomeProject\node_modules\commander\index.js:315:8)
    at Command.emit (events.js:210:5)
    at Command.parseArgs (D:\WORKER\mytest\ReactNative\AwesomeProject\node_modules\commander\index.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:

标签:mep   href   ESS   blacklist   worker   module   action   原因   rbo   

原文地址:https://www.cnblogs.com/zjhblogs/p/11896846.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!