-
[React-native] 개발 환경 구축시 에러 메세지(Window 환경)Debugging 2021. 12. 11. 11:36
1. Could not determine the dependencies of task
* What went wrong: Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'. > SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at 'your_project\android\local.properties'.
Android Studio 환경 변수 설정을 하지 않을 경우 발생할 수 있다.
제어판 > 시스템 > 고급 시스템 설정 > 환경변수 > 사용자 변수 섹션에서 새 사용자 변수 생성 변수 이름은 ANDROID_HOME을 변수값은 Android Studio SDK 위치를 입력해서 저장한다.
자세한 내용은 React-Native 공식 문서를 참조
2. Cannot read properties of undefined (reading 'transformFile')
error: TypeError: Cannot read properties of undefined (reading 'transformFile') at Bundler.transformFile (your_project\node_modules\metro\src\Bundler.js:48:30) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async Object.transform (your_project\node_modules\metro\src\lib\transformHelpers.js:101:12) at async processModule (your_project\node_modules\metro\src\DeltaBundler\traverseDependencies.js:137:18) at async traverseDependenciesForSingleFile (your_project\node_modules\metro\src\DeltaBundler\traverseDependencies.js:131:3) at async Promise.all (index 0) at async initialTraverseDependencies (your_project\node_modules\metro\src\DeltaBundler\traverseDependencies.js:114:3) at async DeltaCalculator._getChangedDependencies (your_project\node_modules\metro\src\DeltaBundler\DeltaCalculator.js:164:25) at async DeltaCalculator.getDelta (your_project\node_modules\metro\src\DeltaBundler\DeltaCalculator.js:94:16) at async DeltaBundler.buildGraph (your_project\node_modules\metro\src\DeltaBundler.js:50:5)
Node.js 삭제 후 Node.js LTS버전(2021년 12월 현재 16.13.1)을 재설치한다.
3. import type {Node} from 'react' Error
visual studio code settings > javascript.validate 을 검색, checkbox를 선택하지 않음으로 변경한다.
Reference
- https://reactnative.dev/docs/environment-setup
- https://dev-yakuza.posstree.com/ko/react-native/install-on-windows/
- https://stackoverflow.com/questions/69647332/cannot-read-properties-of-undefined-reading-transformfile-at-bundler-transfo
- https://stackoverflow.com/questions/48859169/js-types-can-only-be-used-in-a-ts-file-visual-studio-code-using-ts-check
'Debugging' 카테고리의 다른 글
[Android]hilt cannot access DefaultActivityViewModelFactory (0) 2021.09.08 [Android]AppDatabase_lmpl does not exist(Room) (0) 2021.09.08