0

i just started a project and im trying to start the but it already has this error showing:

error: node_modules\react-native\Libraries\Image\ImageAnalyticsTagContext.js: Property body[6] of BlockStatement expected node to be of a type ["Statement"] but instead got "AssignmentExpression"

5
  • Additional Thread: SO thread Commented Aug 5, 2021 at 5:07
  • i had a same problem, but using ios! Commented Aug 5, 2021 at 5:19
  • Follow the issue on Github to get more informations! github.com/facebook/react-native/issues/31961 Commented Aug 5, 2021 at 5:22
  • Please update node version to >= 12 if your using react-native 0.64 Commented Aug 5, 2021 at 7:55
  • @Neil Alden Escobin mark Daniel Sá answer as accepted. So other get help from that Commented Aug 5, 2021 at 11:00

3 Answers 3

1

this is a known issue caused by a bug in a newly released version of babel. it will impact all new react-native and expo apps. you can resolve it with yarn resolutions in a new project:

--- a/package.json +++ b/package.json @@ -25,5 +25,8 @@ }, "jest": { "preset": "react-native" + }, + "resolutions": { + "@babel/plugin-transform-react-display-name": "7.14.5" } } 

After insert resulutions key on the package.json, run yarn install

Credits: https://github.com/brentvatne

Issue Link: https://github.com/facebook/react-native/issues/31961

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

Comments

0

Run this command:
npm install --save-dev @babel/plugin-transform-react-display-name

Comments

0

The problem is due to a babel update that affected the RN project. copy @babel from some other project and paste in node_modules or Download the @babel folder from here and replace the existing folder in the node_modules.@Babel Download

And run

npm start --reset-cache 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.