Backend/패키지매니저

yarn berry eslint 에러

전예방 2024. 1. 7. 20:47

프로젝트에 eslint를 설정해 놓고, fix해주는 코드를 package.json에 작성해놨다.

 

그 후 터미널에서 fix해주는 명령어를 입력했는데 아래 이미지와 같은 에러가 났다

Oops! Something went wrong! :(
ESLint: 8.56.0
Error: synckit tried to access ", but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.
Required package:
" (via
""/var/folders/1v/r80_zlpj7f507kxk80jycc0c0000gn/T/6025ddaa198df01ef650d59d6f3f5c98.cjs"")
Required by: synckit@npm:0.8.8 (via /Users/jeon-yewon/021_projects/fastcampus_project10/react-mcard/yarn/cache/synckit-npm-0.8.8-f5ee4a6dac-2864a5c3e6.zip/node_modules/synckit/lib/)
Require stack:
- /Users/jeon-yewon/021_projects/fastcampus_project10/react-mcard/.yarn/cache/synckit-npm-0.8.8-f5ee4a6dac-2864a5c3e6.zip/node_modules/synckit/lib/index.cjs
- /Users/jeon-yewon/021_projects/fastcampus_project10/react-mcard/•yarn/__virtual__/eslint-plugin-prettier-virtual-5c07c75bf3/0/cache/eslint-plugin-prettier-npm-5.1.2-d18bb6313f-2d99eabbf6.zip/node
_modules/eslint-plugin-prettier/eslint-plugin-prettier.js
- /Users/jeon-yewon/021_projects/fastcampus_project10/react-mcard/.yarn/cache/@eslint-eslintrc-npm-2.1.4-1ff4b5f908-7a3b14f4b4.zip/node_modules/@eslint/eslintrc/dist/eslintrc.cjs
Occurred while linting /Users/jeon-yewon/021_projects/fastcampus_project10/react-mcard/src/App. test.tsx:1
Rule:
"prettier/prettier"
at require$$0.Module._resolveFilename (/private/var/folders/1v/r80_zlpj7f507kxk80jycc0c0000gn/T/6025ddaa198df01ef650d59d6f3f5c98.cjs:23809:13)
at Function.resolve (node:internal/modules/cjs/helpers:116:19)
at /Users/jeon-yewon/021_projects/fastcampus_project10/react-mcard/.yarn/cache/synckit-npm-0.8.8-f5ee4a6dac-2864a5c3e6.zip/node_modules/synckit/lib/index.cjs:205:92
at Array.some (<anonymous>)
at setupTsRunner (/Users/jeon-yewon/021_projects/fastcampus_project10/react-mcard/.yarn/cache/synckit-npm-0.8.8-f5ee4a6dac-2864a5c3e6.zip/node_modules/synckit/lib/index.cjs:204:68)
at startWorkerThread (/Users/jeon-yewon/021_projects/fastcampus_project10/react-mcard/yarn/cache/synckit-npm-0.8.8-f5ee4a6dac-2864a5c3e6.zip/node_modules/synckit/lib/index.cjs:285:7)
at Object.createSyncFn (/Users/jeon-yewon/021_projects/fastcampus_project10/react-mcard/yarn/cache/synckit-npm-0.8.8-f5ee4a6dac-2864a5c3e6.zip/node_modules/synckit/lib/index.cjs:90:18)
at Program (/Users/jeon-yewon/021_projects/fastcampus_project10/react-mcard/.yarn/_virtual__/eslint-plugin-prettier-virtual-5c07c75bf3/0/cache/eslint-plugin-prettier-npm-5.1.2-d18bb6313f-2d99e abbf6.zip/node_modules/eslint-plugin-prettier/eslint-plugin-prettier.js:166:51)
at ruleErrorHandler (/Users/jeon-yewon/021_projects/fastcampus_project10/react-mcard/•yarn/cache/eslint-npm-8.56.0-6eec398a41-ef6193c6e4.zip/node_modules/eslint/lib/linter/linter.js:1076:28)
at /Users/jeon-yewon/021_projects/fastcampus_project10/react-mcard/•yarn/cache/eslint-npm-8.56.0-6eec398a41-ef6193c6e4.zip/node_modules/eslint/lib/linter/safe-emitter.js:45:58

 

⭐️ 해결방법

최상위에 있는 .yarnrc.yml 파일에 아래 이미지와 같은 plugin이 있기 때문에 생긴일 이였다.

console-ninja 플러그인 때문이라니... 

 

맥에서 숨겨진 파일 보는 방법은 cmd + shift + . 

.yarnrc.yml 파일을 vscode로 띄운 후 수정하면 된다.

 

홈 디렉토리에 있는 .yarnrc.yml 파일이다!!!

그냥 싹 지워주자!!!

그러니까 해결완료~~!!

 


📌 참고글

 

yarn berry(pnp)에서 lint 동작시 synckit 관련 에러가 발생할 때

yarn berry(pnp) + eslint + typescript + prettier + NextJS 조합으로 프로젝트를 구성하던 중 eslint를 테스트하다 발생한 에러를 가지고 장장 2주 정도를 고민하며 결국 끈기와 근성으로 에러를 해결한 이야기

velog.io

 

'Backend > 패키지매니저' 카테고리의 다른 글

라이브러리 버전관리와 설치  (0) 2024.01.04
npm 명령어와 셋팅하기 (+라이선스)  (1) 2024.01.04

'Backend/패키지매니저'의 다른글

  • 현재글 yarn berry eslint 에러

관련글