IT이야기

create-react-app을 실 대신 npm으로 만드는 방법?

cyworld 2022. 3. 13. 11:01
반응형

create-react-app을 실 대신 npm으로 만드는 방법?

나는 실을 사용한 튜토리얼을 기반으로 리액션 앱을 만드는 데 급급했다.이제 리액트랩 라이브러리에 만족하지 않아 처음부터 앱을 다시 만들려고 하는데 리액트 부트스트랩으로 전환하고 싶다.

노드를 다시 설치했다.그러나 create-react-app을 실행하면 다음과 같이 "npm" 대신 "yarn"을 사용하라고 되어 있다.

  yarn start
    Starts the development server.

  yarn build
    Bundles the app into static files for production.

  yarn test
    Starts the test runner.

  yarn eject
    Removes this tool and copies build dependencies, configuration files
    and scripts into the app directory. If you do this, you can’t go back!

We suggest that you begin by typing:

  cd react-test
  yarn start

npm이 더 널리 사용되는 것 같고, 그것을 바탕으로 한 예시가 더 많은 것 같아서 사용하고 싶다.내가 실에 갇힌 걸까, 아니면 npm을 사용해도 될까?

둘 중 하나라도 좋다.

1) 제거yarn.lock, 및 실행npm i,

또는

2) 뛰다create-react-app app --use-npm

1 ⇢ 설치한 경우create-react-app그런 다음 다음을 사용하십시오.

create-react-app --use-npm

2 ⇢ 사용시npx명령어 사용:

npx create-react-app --use-npm

3 existing 현존하는 경우yarnapp, 제거yarn.lock파일 및 실행:

npm i

또는

npm install
  1. create-react-app 설치npm i -g create-react-app --use-npm
  2. cd 명령을 사용하여 원하는 경로로 이동
  3. --use-npm 추가create-react-app my-app-name --use-npm이 명령은 현재 경로에 언급된 이름으로 폴더를 만든다.이 폴더는 반응 응용 프로그램을 위한 스타터 코드에 필요한 모든 구성 파일을 구성한다.

이것이 도움이 될지 모르겠다.하지만 나도 같은 문제를 겪고 있었고 이렇게 했어.

npx expo-cli init --npm

그리고 그것은 npm과 함께 설치되었다.

이것이 당신이나 미래에 누군가에게 도움이 되기를 바란다.

참조URL: https://stackoverflow.com/questions/61938502/how-to-make-create-react-app-use-npm-instead-of-yarn

반응형