【问题标题】:react-native init MyProject --version 0.58.6 but every time i do this , there comes an error as followsreact-native init MyProject --version 0.58.6 但每次我这样做时,都会出现如下错误
【发布时间】:2021-05-01 00:01:47
【问题描述】:

我正在尝试使用命令 react-native init MyProject --version 0.58.6 来初始化一个新的 react native 项目 但每次我这样做时,都会出现如下错误 - 在 80.32 秒内完成。

D:\MyProject\node_modules\metro-config\src\defaults\blacklist.js:34
返回新的正则表达式( ^

语法错误:无效的正则表达式: /(.\fixtures\.|node_modules[\]react[\]dist[\].|website\node_modules\.|heapCapture \bundle.js|.\测试\.)$/: 未终止的字符类 在新的正则表达式 () 在黑名单中 (D:\MyProject\node_modules\metro-config\src\defaults\blacklist.js:34:10) 在 getBlacklistRE (D:\MyProject\node_modules\react-native\local-cli\util\Config.js:56:10) 在对象。 (D:\MyProject\node_modules\react-native\local-cli\util\Config.js:71:20) 在 Module._compile (internal/modules/cjs/loader.js:959:30) 在 Module._compile (D:\MyProject\node_modules\pirates\lib\index.js:99:24) 在 Module._extensions..js (internal/modules/cjs/loader.js:995:10) 在 Object.newLoader [as .js] (D:\MyProject\node_modules\pirates\lib\index.js:104:7) 在 Module.load (internal/modules/cjs/loader.js:815:32) 在 Function.Module._load (internal/modules/cjs/loader.js:727:14)

构建依赖关系完成后

【问题讨论】:

    标签: react-native npm


    【解决方案1】:

    似乎是老版本 react-native 的 bug 我也遇到过这个问题,我用 StackOverflow 的回答解决了同样的问题:

    How to resolve the error on 'react-native start'

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-10-01
      • 1970-01-01
      • 2022-07-26
      • 1970-01-01
      相关资源
      最近更新 更多