Javascript/React

[React] "@babel/plugin-proposal-private-property-in-object" ...

eulBlue 2024. 4. 12. 10:23

 

📱테스트 환경

"react": "18.2.0"
"react-dom": "18.2.0"
"typescript": "^4.9.5"

학생이메일로 기분좋게 WebStorm 을 사용하고 있었는데

갑자기 이메일 정리로 인해 계정이 막혀버렸다 ...😭

아무튼 .. 이 당시 WebStorm 으로 React Typescript 프로젝트를 생성했었는데프로젝트를 실행시킬때마다

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 maintained 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 을 사용하지도 않는데 ..

ㅇㅏ무튼 찾아보니까 WebStorm 을 이용해서 만든 프로젝트에서 babel 을 사용하는걸로 의심되었고

이를 해결하기 위해서는 

npm install --save-dev @babel/plugin-proposal-private-property-in-object

해당 종속성을 설치해주면 된다.

이거 설치해서 안된다는 말도 있고 ..

-save-dev 를 통해 devDependencies 에 설치하라는 말도 있고 ..

에러에 관해서 처리하는 방법이 너무 다양하지만 해당 방법이 나에겐 가장 좋은 방법인것 같아 사용하였다.