Reputation: 826
When upgrading to RN 0.59.4 and after a successful build - one can encounter the following error in metro bundler:
react native Cannot find module 'metro/src/reactNative Transformer
Upvotes: 11
Views: 33823
Reputation: 399
My issue was fixed after I uninstalled react-native-svg-transformer
and reinstalled it with npm i -D react-native-svg-transformer
Upvotes: 0
Reputation: 109
I got this error message after upgrading to the latest expo version because I was getting the warning: "The global expo-cli package has been deprecated."
I fixed the error by running "npx expo install --fix".
Upvotes: 9
Reputation: 20882
Since you upgraded ReactNative, you must close terminal where Metro
is running and then re-run npx react-native start
Upvotes: 1
Reputation: 303
I solved the problem by deleting the node_modules folder and the package-lock.json file and then running again npm install
Upvotes: 6
Reputation: 2172
I think there's an issue with the version of metro packaged with the latest RN Upgrade.
I just installed locally in dev metro npm install --save-dev metro
, which is the version 0.51.1, and that worked for me.
Reference: https://github.com/facebook/metro/issues/293#issuecomment-452779809
Upvotes: 9
Reputation: 826
Make sure that you at least:
"metro-react-native-babel-preset": "0.53.1"
In dev dependencies in your package.json file
Upvotes: 2