I am trying to run react native app on Andriod but I am getting this error presets: ['module:metro-react-native-babel-preset'],
, Could someone please help me to how to resolve this issue.
const {getDefaultConfig} = require('metro-config');
module.exports = {
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: true,
},
}),
},
};
module.exports = (async () => {
const {
resolver: {sourceExts, assetExts},
} = await getDefaultConfig();
return {
transformer: {
babelTransformerPath: require.resolve('react-native-svg-transformer'),
},
resolver: {
assetExts: assetExts.filter(ext => ext !== 'svg'),
sourceExts: [...sourceExts, 'svg'],
},
};
})();
2
Answers
Please check metro-react-native-babel-preset dependency was
installed in your package.json file.
If not, install it using this command:
npm i metro-react-native-babel- preset --save-dev
Please check babel.config.js file
There should be this code:
Just update node to the latest version