android - 在 react-native 项目中找不到 metro-config node_modules
问题描述
我在我的项目中提供“react-native start”命令,它给了我以下错误。
无效的正则表达式:/(。\__fixtures__\。 |node_modules[\]react[\]dist[\]。|website\node_modules\。 |heapCapture\bundle.js|。\__tests__\。 )$/:未终止的字符类
但问题是当我试图导航"node_modules\metro-config\src\defaults\blacklist.js"
到此路径时,没有名为"metro-config"
.
我确实删除了 node_modules 并再次重新安装它们,但问题仍然相同。
解决方案
您也可以在此位置找到blacklist.js
文件,node_modules/metro/src/blacklist.js
. 在该文件中进行相同的更改。
代替
var sharedBlacklist = [
/node_modules[/\\]react[/\\]dist[/\\].*/,
/website\/node_modules\/.*/,
/heapCapture\/bundle\.js/,
/.*\/__tests__\/.*/
];
和
var sharedBlacklist = [
/node_modules[\/\\]react[\/\\]dist[\/\\].*/,
/website\/node_modules\/.*/,
/heapCapture\/bundle\.js/,
/.*\/__tests__\/.*/
];
我昨晚才修好的。
推荐阅读
- python - 如何以英寸为单位获得 matplotlib 绘图区域的大小?
- sql - 如何在PostgreSQL数据库中只保留一个条目
- c++ - c ++双向链表错误C2664'object1 :: object1(object1 &&)':无法将参数1从'int'转换为'const object1 &'
- c# - 什么是 WPF Datagrid 开头的(空)列称为
- python - 如何修复 aiohttp 应用程序中初始化引擎的 aiopg 异常?
- html - Pictures don't align and won't scale properly
- java - 如何使用一个 logback appender 从 2 个进程记录到 2 个不同的文件?
- python - 损失函数在 Tensorflow 中是如何工作的?它们是如何从批次中计算出来的?
- c++ - 向其添加新部分时,PE 可执行文件已损坏
- r - R Shiny 更改面板上的表格位置?