cli로 프로젝트를 생성하면 아래와 같은 오류가 발생합니다. (npx react-native init 프로젝트명 명령어 실행 후 오류)
TypeError: cli.init is not a function
Installing react-native...
Consider installing yarn to make this faster: https://yarnpkg.com
npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated uglify-es@3.3.9: support for ECMAScript is superseded by `uglify-js` as of v3.13.0
added 652 packages, and audited 653 packages in 7s
33 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
C:\Users\YUN\AppData\Roaming\npm\node_modules\react-native-cli\index.js:302
cli.init(root, projectName);
^
TypeError: cli.init is not a function
at run (C:\Users\YUN\AppData\Roaming\npm\node_modules\react-native-cli\index.js:302:7)
at createProject (C:\Users\YUN\AppData\Roaming\npm\node_modules\react-native-cli\index.js:249:3)
at init (C:\Users\YUN\AppData\Roaming\npm\node_modules\react-native-cli\index.js:200:5)
at Object.<anonymous> (C:\Users\YUN\AppData\Roaming\npm\node_modules\react-native-cli\index.js:153:7)
at Module._compile (node:internal/modules/cjs/loader:1159:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
at Module.load (node:internal/modules/cjs/loader:1037:32)
at Module._load (node:internal/modules/cjs/loader:878:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:23:47
해당 오류는 버전이 맞지않아 발생한 오류입니다.
react-native 버전을 낮춰 프로젝트를 실행하면 정상적으로 생성됩니다.
npx react-native init 프로젝트명 --version 0.68.2
'*오류해결' 카테고리의 다른 글
A problem occurred evaluating project ':app' 오류 (0) | 2023.02.16 |
---|---|
Execution failed for task ':react-native-gradle-plugin:compileKotlin' 오류 (0) | 2023.02.14 |
java.lang.StringIndexOutOfBoundsException 오류 (0) | 2022.02.04 |
The maximum column width for an individual cell is 255 characters 오류 (1) | 2021.10.25 |
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException 오류 (1) | 2021.10.14 |
댓글