IT/React-Native

[React-Native] 프로젝트 생성에서부터 삐걱 Input is required, but Expo CLI is in non-interactive mode.

월공 2022. 8. 18. 13:45
728x90
300x250

React Native 강의를 좀 들어보고있는데 xde 를 쓰네, 근데 xde 는 서비스 종료했다고 하네 ?

어쨌든 아래 npm 명령어로 expo-cli 설치하고 프로젝트 생성해서 좀 해볼라하는데 오류가 난다

아 참고로 npm install 할때 자꾸 말썽이면 아싸리 node, npm 재설치하는게 낫다

npm install expo-cli --global

// React-Native 프로젝트 생성할 경로
c/web_developer/react-native

//react-native 프로젝트 생성
expo init [프로젝트명]

아래와 같은 오류 발생

cd rn[13:04:41] Input is required, but Expo CLI is in non-interactive mode.
--template: argument is required in non-interactive mode. Valid choices are: "blank", "tabs", "bare-minimum" or any custom template (name of npm package).

찾아보니 git bash 에서 실행시켜서 에러나는거라고 함
깔끔한건 git bash 가 최고인데 이 녀석이 복병이었을줄이야 .. 에휴

여튼 powershell 열고 여기서 실행시키니까 프로젝트는 정상적으로 생성됨

expo start 로 실행시켜볼라니깐 여기서 또 에러 발생 ㅋㅋㅋㅋ
아직 react native 제대로 시작도 안해봤는데 하기도전에 벌써 싫어질라한다 ..

Starting project at C:\web_developer\react-native\rn2
√ It looks like you're trying to use web support but don't have the required dependencies installed. Would you like to
install react-native-web, react-dom? ... yes

× Failed to install react-native-web@~0.18.7, react-dom with error: npm exited with non-zero code: 1

에러 문구 보니 react-native 랑 react-dom 안깔려있다고 해서 
적당히 npm install 로 각각 설치하고 다음 넘어가려하는데 또 아래와 같은 에러 발생

This command is being executed with the global Expo CLI. Learn more: https://blog.expo.dev/the-new-expo-cli-f4250d8e3421
To use the local CLI instead (recommended in SDK 46 and higher), run:
› npx expo start

Starting project at C:\web_developer\react-native\rn2
"react-native-web" is added as a dependency in your project's package.json but it doesn't seem to be installed. Please run "yarn" or "npm install" to fix this issue.


npm install 치는데 안먹혀서 아래 명령어로 해결

npm install --legacy-peer-deps

이제 expo start 하면 아래와 같이 정상적으로 실행이 되는데 이건 그 expo 앱 연동해서 데스크탑이랑 모바일에서 같은 네트워크 , 같은 공유기 썻을때 확인할 수 있는거고 나는 pc 웹페이지 에서 바로 띄워서 보고싶으니깐

다시 expo start -w 로 실행했는데

아까 react-dom 깔았는데 왜이러는지 -- ;;
package.json 에도 이상없이 잘 들어가있는데 ..

여튼 npm install 했는데 위 처럼 또 에러 뜨길래 또 강제로 npm install --legacy-peer-deps 쳐서 install 하고 난 후에 

expo start -w 하니까 잘 띄워진다.
왜 이리 찜찜한건데 ~

728x90
300x250