*/

React-native App 생성 오류

react-native 로 App을 개발할 때 아래와 같은 명령으로 Typescript 템플릿으로 App을 생성시
$> npx react-native init AwesomeTSProject --template react-native-template-typescript

아래와 같은 오류가 발생
error An unexpected error occurred: "https://registry.yarnpkg.com/react-native-template-react-native-template-typescript: Not found".
info If you think this is a bug, please open a bug report with the information provided in "D:\\work\\reacttest\\AwesomeTSProject\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
yarn remove v1.22.19
[1/2] Removing module react-native-template-react-native-template-typescript...
error This module isn't specified in a package.json file.
info Visit https://yarnpkg.com/en/docs/cli/remove for documentation about this command.
warn Failed to clean up template temp files in node_modules/react-native-template-react-native-template-typescript. This is not a critical error, you can work on your app.
D:\work\reacttest\AwesomeTSProject\node_modules\metro-hermes-compiler\src\emhermesc.js:77
          throw ex;
          ^

RuntimeError: abort(Error: Command failed: yarn add react-native-template-react-native-template-typescript). Build with -s ASSERTIONS=1 for more info.
    at process.abort (D:\work\reacttest\AwesomeTSProject\node_modules\metro-hermes-compiler\src\emhermesc.js:402:15)

Nodejs, JAVA JDK를 새로 깔아도 오류가 계속 발생.
react-native-cli를 새로 설치하니 문제가 해결되었다.

$> npm uninstall react-native-cli
$> yarn global add @react-native-community/cli
$> npx react-native init AwesomeTSProject --templete react-native-typescript







0 comments:

댓글 쓰기