SyntaxError:Strict mode does not allow function declaration in a lexically nested statement.
Paste_Image.png

解决办法
这个问题是官方遗留的问题.不要怀疑你自己


打开node_modules / react-native / Libraries / Core / InitializeCore.js第112
行将函数handleError(e,isFatal)更改为var handleError = function(e,isFatal)


很多小伙伴找不到这个目录,那是因为版本不同.再放出一个路径


node_modules / react-native / Libraries / JavaScriptAppEngine / Initialization / InitializeJavaScriptAppEngine.js


线〜120


最后还要写一段命令行


npm start -- --reset-cache

其实你也可以这么做


SyntaxError:Strict mode does not allow function declaration in a lexically nested statement.
Paste_Image.png

开启debug 调试模式


然后就可以运行项目了




相关文章:

  • 2022-12-23
  • 2021-07-20
  • 2022-12-23
  • 2021-10-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-11
  • 2022-12-23
相关资源
相似解决方案