babel v7에서 babel-jest 적용기
babel-jest 공식 페이지에 따르면 babel7에서 babel-jest를 사용하려면 다음 명령어로 babel-jest, babel-core@^7.0.0-bridge.0, @babel/core 를 설치해야 한다.
npm install -D babel-jest babel-core@^7.0.0-bridge.0 @babel/core regenerator-runtime
그런데 다음과 같은 에러가 나더라
Requires Babel "^7.0.0-0", but was loaded with "6.26.3". If you are sure you have a compatible version of @babel/core, it is likely that something in your build process is loading the wrong version. Inspect the stack trace of this error to look for the first entry that doesn't mention "@babel/core" or "babel-core" to see what is calling Babel.
~~블라블라~~
이거저거 검색해서 별짓을 다해봤는데, 해결이 안됐음. 그러다가 matermost wepapp 소스를 봤는데 이놈도 바벨 v7인데 잘 동작하더라. 그래서 package.json 을 살펴보니... jest가 로컬에 설치되어 있었다. 난 jest를 글로벌에 설치했었는데....
그래서 로컬에도 jest를 설치해주니 잘 동작한다! 당황스럽다.... npm ls 명령어로 전역으로 설치된 jest를 보니 하위에 babel-core@6.26.3 이 보인다. 아무래도 전역에 설치된 jest가 문제가 되는것 같다. 로컬 설치 혹은 노드 재설치가 답이겠지...
'개발개발' 카테고리의 다른 글
리셀렉트에 대한 이해 (0) | 2019.08.21 |
---|---|
Expected linebreaks to be 'LF' but found 'CRLF' (0) | 2019.01.30 |
Mattermost 개발환경 구축기 (0) | 2018.11.12 |
Webpack dev server, Spring 개발 환경 구축 (0) | 2018.11.07 |
클라우드 Mongodb 사용해보기 (1) | 2018.09.21 |