
알고있으면 좋은 React Tip✨
npm start 시 터미널에 bebel dependencies 오류 메세지 발생하는 경우
- 터미널에서 npm start를 입력하니 아래와 같은 문구가 발생되었다.
- 아래와 같은 문구가 발생 된 시점은? 등록 페이지에서 등록한 폼 데이터 중 이미지를 가져오려고 하는데 브라우저가 보안 제한으로 로컬 파일을 로딩하지 못하게 막고 있어 경로를 기존 server/uploads 에서 client/public/uploads 경로로 이동 후 재실행하니까 아래와 같은 문구가 터미널에 발생하였다.
One of your dependencies, babel-preset-react-app, is importing the
"@babel/plugin-proposal-private-property-in-object" package without
declaring it in its dependencies. This is currently working because
"@babel/plugin-proposal-private-property-in-object" is already in your
node_modules folder for unrelated reasons, but it may break at any time.
babel-preset-react-app is part of the create-react-app project, which
is not maintianed anymore. It is thus unlikely that this bug will
ever be fixed. Add "@babel/plugin-proposal-private-property-in-object" to
your devDependencies to work around this error. This will make this message
go away.
- 위의 경고는 프로젝트의 의존성 중 하나인 babel-preset-react-app이 @babel/plugin-proposal-private-property-in-object 패키지를 의존성으로 선언하지 않고 사용하고 있어서 발생하는 것이라고 한다.
- 이러한 종류의 경고는 종종 의존성 트리의 변경으로 인해 나타날 수 있습니다. 경고를 해결하려면 해당 패키지를 프로젝트의 devDependencies에 추가하면 된다.
(1) 해결방법
npm install --save-dev @babel/plugin-proposal-private-property-in-object
- 프로젝트의 package.json 파일을 확인하여 devDependencies 섹션에 @babel/plugin-proposal-private-property-in-object이 추가되었는지 확인해보면 된다.
'Study > React' 카테고리의 다른 글
| [React] state (0) | 2023.10.16 |
|---|---|
| [React] Props (0) | 2023.10.16 |
| [React] 컴포넌트(component) (0) | 2023.10.13 |
| [React] 리엑트 설치하기 (0) | 2023.10.13 |