reanimated2 installation: Cannot find module '@babel/plugin-transform-shorthand-properties'
See original GitHub issueDescription
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 reinstallyarn 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:
- Created a year ago
- Comments:6 (2 by maintainers)
@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 memy node version: v16.2.0
@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: