React webpack version & node-sass error (M1)

dabin *.◟(ˊᗨˋ)◞.*·2021년 8월 30일
0

React

목록 보기
3/14
post-thumbnail

webpack

npm start시 아래와 같은 오류가 발생했고, 작업 폴더의 상위 폴더에 있는 webpack폴더를 삭제해 해결했다.

There might be a problem with the project dependency tree. It is likely not a bug in Create React App, but something you need to fix locally.

The react-scripts package provided by Create React App requires a dependency:

"webpack": "필요한 버전 숫자"

Don't try to install it manually: your package manager does it automatically. However, a different version of webpack was detected higher up in the tree:

/Users/dabin/node_modules/webpack (version: "현재 웹팩 버전")

아래와 같이 무시를 하고 진행할 수도 있었으나, 나중에 또 에러가 날 것 같아서 다른 해결방법을 찾아보았다.

If you would prefer to ignore this check, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project. That will permanently disable this message but you might encounter other issues.

마침내,,, 아래와 같은 메뉴얼을 따라가며 해결하고자 했으나 npm start가 되지 않았다.

To fix the dependency tree, try following the steps below in the exact order:

Delete package-lock.json (not package.json!) and/or yarn.lock in your project folder.
Delete node_modules in your project folder.
Remove "webpack" from dependencies and/or devDependencies in the package.json file in your project folder.
Run npm install or yarn, depending on the package manager you use.
In most cases, this should be enough to fix the problem. If this has not helped, there are a few other things you can try:

현재 작업 폴더와 conflict가 난 상위폴더의 webpack을 삭제해주었더니 해결되었다.

Check if /Users/dabin/node_modules/webpack is outside your project directory. For example, you might have accidentally installed something in your home folder.

Try running npm ls webpack in your project folder. This will tell you which other package (apart from the expected react-scripts) installed webpack.

node-sass

Node Sass does not yet support your current environment

위와 같은 오류가 난 경우 Dart sass를 설치해준다.

npm i sass --save-dev
profile
모르는것투성이

0개의 댓글