Please provide the following:
- SDK Version:47.0.0
- Platforms(Android/iOS/web/all):all
I was trying to install TypeScript to my existing Expo app, but i am unsuccessful.
First I created a tsconfig.json
in my root, then I ran npx expo start
.
It detected I am trying to use TS, it asked me to install it, and I said yes, but then it always ends up with this error:
√ It looks like you’re trying to use TypeScript but don’t have the required dependencies installed. Would you like to install typescript@^4.6.3? … yes
› Installing 1 SDK 47.0.0 compatible native module using npm
npm install
/ Installing typescript@^4.6.3npm WARN config global--global
,--local
are deprecated. Use--location=global
instead.
/ Installing typescript@^4.6.3npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: react-native-elements@3.4.2
npm ERR! Found: react-native-safe-area-context@4.4.1
npm ERR! node_modules/react-native-safe-area-context
npm ERR! react-native-safe-area-context@“4.4.1” from the root project
npm ERR! peer react-native-safe-area-context@“>= 3.0.0” from @react-navigation/bottom-tabs@6.4.0
npm ERR! node_modules/@react-navigation/bottom-tabs
npm ERR! @react-navigation/bottom-tabs@“^6.4.0” from the root project
npm ERR! 3 more (@react-navigation/drawer, …)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react-native-safe-area-context@“^3.1.9” from react-native-elements@3.4.2
npm ERR! node_modules/react-native-elements
npm ERR! react-native-elements@“^3.4.2” from the root project
npm ERR!
npm ERR! Conflicting peer dependency: react-native-safe-area-context@3.4.1
npm ERR! node_modules/react-native-safe-area-context
npm ERR! peer react-native-safe-area-context@“^3.1.9” from react-native-elements@3.4.2
npm ERR! node_modules/react-native-elements
npm ERR! react-native-elements@“^3.4.2” from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\stesv\AppData\Local\npm-cache\eresolve-report.txt for a full report.npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\stesv\AppData\Local\npm-cache_logs\2022-11-22T01_29_54_740Z-debug-0.log
Failed to install typescript@^4.6.3 with error: npm exited with non-zero code: 1
Error: npm exited with non-zero code: 1
Error: npm exited with non-zero code: 1
at ChildProcess.completionListener (R:\iGradePlus\iGradePlus-mobile\node_modules@expo\spawn-async\build\spawnAsync.js:52:23)
at Object.onceWrapper (node:events:642:26)
at ChildProcess.emit (node:events:527:28)
at ChildProcess.cp.emit (R:\iGradePlus\iGradePlus-mobile\node_modules\cross-spawn\lib\enoent.js:34:29)
at maybeClose (node:internal/child_process:1092:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
…
at spawnAsync (R:\iGradePlus\iGradePlus-mobile\node_modules@expo\spawn-async\build\spawnAsync.js:17:21)
at NpmPackageManager._runAsync (R:\iGradePlus\iGradePlus-mobile\node_modules@expo\package-manager\build\NodePackageManagers.js:133:51)
at NpmPackageManager.installAsync (R:\iGradePlus\iGradePlus-mobile\node_modules@expo\package-manager\build\NodePackageManagers.js:59:20)
at NpmPackageManager.addWithParametersAsync (R:\iGradePlus\iGradePlus-mobile\node_modules@expo\package-manager\build\NodePackageManagers.js:72:24)
at async installPackagesAsync (R:\iGradePlus\iGradePlus-mobile\node_modules@expo\cli\build\src\install\installAsync.js:82:5)
at async installPackagesAsync (R:\iGradePlus\iGradePlus-mobile\node_modules@expo\cli\build\src\start\doctor\dependencies\ensureDependenciesAsync.js:115:9)
at async Object.ensureDependenciesAsync (R:\iGradePlus\iGradePlus-mobile\node_modules@expo\cli\build\src\start\doctor\dependencies\ensureDependenciesAsync.js:74:13)
at async TypeScriptProjectPrerequisite._ensureDependenciesInstalledAsync (R:\iGradePlus\iGradePlus-mobile\node_modules@expo\cli\build\src\start\doctor\typescript\TypeScriptProjectPrerequisite.js:89:20)
at async TypeScriptProjectPrerequisite.assertImplementation (R:\iGradePlus\iGradePlus-mobile\node_modules@expo\cli\build\src\start\doctor\typescript\TypeScriptProjectPrerequisite.js:55:9)
at async TypeScriptProjectPrerequisite.assertAsync (R:\iGradePlus\iGradePlus-mobile\node_modules@expo\cli\build\src\start\doctor\Prerequisite.js:26:20)
Any idea? I am not sure what steps to take when there are dependencies issues…