question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

reanimated2 installation: Cannot find module '@babel/plugin-transform-shorthand-properties'

See original GitHub issue

Description

Hello, i’m trying to install reanimated2, i’ve followed the doc installations steps, but i’m getting this error message: node_modules/react-native-reanimated/src/createAnimatedComponent.tsx: /myProject/node_modules/react-native-reanimated/src/createAnimatedComponent.tsx: Cannot find module '@babel/plugin-transform-shorthand-properties' from '/myProject' what i tried in hope to resolve the issue :

  • install @babel/plugin-transform-shorthand-properties using yarn add @babel/plugin-transform-shorthand-properties. unfortunately note working. it keeps showing the same error message with different missing babel plugin.
  • remove node_modules rm -rf node_modules yarn.lock and reinstall yarn install yarn start --reset-cache. also note working.

Expected behavior

use animated API from reanimated2 without any error

Package versions

“dependencies”: { “@babel/parser”: “^7.18.3”, “@babel/traverse”: “^7.18.2”, “@react-keycloak/native”: “^0.6.2”, “@react-native-async-storage/async-storage”: “^1.17.6”, “@react-navigation/native”: “^6.0.10”, “@react-navigation/native-stack”: “^6.6.2”, “axios”: “^0.27.2”, “date-fns”: “^2.28.0”, “formik”: “^2.2.9”, “glob”: “^8.0.3”, “lodash”: “^4.17.21”, “query-string”: “^7.1.1”, “react”: “17.0.2”, “react-i18next”: “^11.16.9”, “react-native”: “0.68.2”, “react-native-date-picker”: “^4.2.2”, “react-native-dropdown-picker”: “^5.4.2”, “react-native-inappbrowser-reborn”: “^3.6.3”, “react-native-material-menu”: “^2.0.0”, “react-native-reanimated”: “2.3.1”, “react-native-safe-area-context”: “^4.2.5”, “react-native-screens”: “^3.13.1”, “react-native-svg”: “^12.3.0”, “react-redux”: “^8.0.2”, “redux-saga”: “^1.1.3”, “yup”: “^0.32.11” }, “devDependencies”: { “@babel/core”: “7.12.9”, “@babel/runtime”: “7.12.5”, “@react-native-community/eslint-config”: “2.0.0”, “@reduxjs/toolkit”: “^1.8.2”, “@types/jest”: “27.4.0”, “babel-eslint”: “10.1.0”, “babel-jest”: “26.6.3”, “eslint”: “7.14.0”, “eslint-config-prettier”: “6.15.0”, “eslint-plugin-detox”: “1.0.0”, “eslint-plugin-import”: “2.25.4”, “eslint-plugin-node”: “11.1.0”, “eslint-plugin-promise”: “6.0.0”, “eslint-plugin-react”: “7.28.0”, “eslint-plugin-react-hooks”: “4.3.0”, “eslint-plugin-react-native”: “3.11.0”, “eslint-plugin-react-native-a11y”: “3.2.1”, “eslint-plugin-redux-saga”: “1.3.2”, “i18next”: “^21.8.4”, “jest”: “26.6.3”, “metro-config”: “^0.71.0”, “metro-react-native-babel-preset”: “0.66.2”, “react-native-svg-transformer”: “1.0.0”, “react-test-renderer”: “17.0.2” },

Affected platforms

  • Android
  • iOS

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

7reactions
ELMAJOULIcommented, Aug 2, 2022

@tomekzaw thank you, i solved the error using the provided issue reference. I installed yarn add @babel/preset-env @babel/preset-typescript --dev and it worked for me

my node version: v16.2.0

2reactions
tomekzawcommented, Aug 2, 2022

@ELMAJOULI Which version of node do you use? You can check this with node --version.

Also, check out the solution from this issue and let us know if it helps:

Read more comments on GitHub >

github_iconTop Results From Across the Web

@babel/plugin-transform-shorthand-properties - npm
Start using @babel/plugin-transform-shorthand-properties in your project by running `npm i @babel/plugin-transform-shorthand-properties`.
Read more >
error: index.js: Cannot find module 'babel-plugin-r' React Native
I wanted to use Drawer Navigation and had to install React Native Reanimated 2.3.0-alpha.2 . what I have already tried to resolve the...
Read more >
babel/plugin-transform-shorthand-properties
Installation. npm install --save-dev @babel/plugin-transform-shorthand-properties. Copy. Usage. With a configuration file (Recommended).
Read more >
Installation | React Native Reanimated - Software Mansion
The steps needed to get reanimated properly configured are listed in the below paragraphs. ... Add Reanimated's babel plugin to your babel.config.js :....
Read more >
failed to initialize react-native-reanimated library - You.com
Plugins section in Android main project build.gradle and missing modules ... @babel/plugin-transform-shorthand-properties@7.2.0" has unmet peer dependency ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found