node_modules/react-native/Libraries/LogBox/Data/parseLogBoxLog.js:
/Users/rakshithkumars/Number-Guessing/node_modules/react-native/Libraries/LogBox/Data/parseLogBoxLog.js:
.useUnicodeFlag is not a valid regexpu-core option.
我用这种方式修复了它:
运行:
yarn add @babel/plugin-proposal-unicode-property-regex --dev
或
npm install --save-dev @babel/plugin-proposal-unicode-property-regex
然后打开babel.config.js
文件,它可能是这样的:
module.exports = function (api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
};
};
加上这一行:
plugins: ['@babel/plugin-proposal-unicode-property-regex'],
结果应该是这样的:
module.exports = function (api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
plugins: ['@babel/plugin-proposal-unicode-property-regex'],
};
};
注:这不应该改变任何东西,但是,在尝试这个改变之前,我从节点14迁移到了节点16。不应该影响,但是。。。只是以防万一。
注2:在我的情况下,没有必要运行expo r -c
。
遇到了同样的问题,并通过将以下插件添加到babel.config.js
:来修复它
@babel/plugin-proposal-unicode-property-regex
然后运行expo r -c
清除缓存