在本地反应项目中找不到Metro-config node_modules

我在我的项目中正在执行“ react-native start”命令,它给了我下面的错误。

  

无效的正则表达式:/(。 \ __ fixtures __ \。 | node_modules [\]反应[\] dist [\]。 | website \ node_modules \。 | heapCapture \ bundle.js |。 \ __ tests __ \。)$ /:不终止的字符类

I have found above problem solution here.

但是问题是,当我尝试导航至"node_modules\metro-config\src\defaults\blacklist.js"此路径时,没有名为"metro-config"的文件夹。

我确实删除了node_modules并再次重新安装它们,但是问题仍然存在。

nikoliu1 回答:在本地反应项目中找不到Metro-config node_modules

签入speaker_id文件夹,如果您查看子目录,则也可以在其中找到node_modules/metro。在该文件中进行相同的更改。

替换

blacklist.js

使用

var sharedBlacklist = [
  /node_modules[/\\]react[/\\]dist[/\\].*/,/website\/node_modules\/.*/,/heapCapture\/bundle\.js/,/.*\/__tests__\/.*/
];

P.S。我不记得确切的路径,但是我昨晚才修复了它。

,

简单解决方案->要找到Metro-config,请在窗口搜索栏中输入Metro-config或直接键入blacklist.js,您将找到文件的确切位置

本文链接:https://www.f2er.com/3009722.html

大家都在问