13

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

6 Answers 6

17

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".

Sign up to request clarification or add additional context in comments.

Comments

9

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

Comments

6

I solved the problem by deleting the node_modules folder and the package-lock.json file and then running again npm install

Comments

2

Make sure that you at least:

"metro-react-native-babel-preset": "0.53.1"
In dev dependencies in your package.json file

Comments

1

Since you upgraded ReactNative, you must close terminal where Metro is running and then re-run npx react-native start

Comments

0

My issue was fixed after I uninstalled react-native-svg-transformer and reinstalled it with npm i -D react-native-svg-transformer

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.