RUBY

[React] yarn start 에러 본문

카테고리 없음

[React] yarn start 에러

RUBY_루비 2020. 9. 21. 23:59
Manually installing incompatible versions is known to cause hard-to-debug issues
.

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

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

  1. Delete package-lock.json (not package.json!) and/or yarn.lock in your proje
ct folder.
  2. Delete node_modules in your project folder.
  3. Remove "webpack" from dependencies and/or devDependencies in the package.js
on file in your project folder.
  4. 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:

  5. If you used npm, install yarn (http://yarnpkg.com/) and repeat the above st
eps with it instead.
     This may help because npm has known issues with package hoisting which may
get resolved in future versions.

  6. Check if C:\Users\node_modules\webpack is outside your project direc
tory.
     For example, you might have accidentally installed something in your home f
older.

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

If nothing else helps, add SKIP_PREFLIGHT_CHECK=true to an .env file in your pro
ject.
That would permanently disable this preflight check in case you want to proceed
anyway.

yarn start 하다가 에러가 났는데,  node_modules 를 삭제해보고 여러 케이스를 해봐도 해결되지 않았다. 이것은 webpack의 버전이 맞지 않아 생기는 에러이다 

 

 

해결방법

vscode로 개발중이였는데, 

1. .env 파일을 만든다.

2. .env 파일에 아래 코드를 추가한다

SKIP_PREFLIGHT_CHECK=true 

 

Comments