vscode의 prettier에 cannot format 'xxxx'가 표시되고 포맷 할 수없는 문제를 해결하는 방법
배경
vscode에서 평소대로 편집하면 코드가 포맷되지 않습니다 ....
화면 아래를 보면 prettier가 Extension 'Prettier - Code formatter' cannot format 'package.json'
라는 오류를 토하고있었습니다.

콘솔에도 다음과 같은 오류가 발생했습니다.
[2021-06-22 23:56:05.392] [exthost] [error] Activating extension esbenp.prettier-vscode failed due to an error:
[2021-06-22 23:56:05.392] [exthost] [error] Error: Cannot find module 'prettier'
원인 및 해결 방법
원인은 prettier-vscode
의 버젼이 8.0.0 이 되어 이상하게 된 것 같습니다.
일단은 버전을 드리는 것으로 해소합니다.
버전을 낮추려면 확장 프로그램 목록을 열고 pretier를 마우스 오른쪽 버튼으로 클릭하면 나타나는 Install Another Version에서 설치할 버전을 지정합니다.


마지막으로 확장 기능이 자동으로 업데이트되지 않도록 확장 기능 설정의 "..."를 누르면 표시되는 "Auto Update Extensions"를 "None"으로 둡니다.
Reference
이 문제에 관하여(vscode의 prettier에 cannot format 'xxxx'가 표시되고 포맷 할 수없는 문제를 해결하는 방법), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/allJokin/items/7f9d6f98be27449ab624
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)
[2021-06-22 23:56:05.392] [exthost] [error] Activating extension esbenp.prettier-vscode failed due to an error:
[2021-06-22 23:56:05.392] [exthost] [error] Error: Cannot find module 'prettier'
원인은
prettier-vscode
의 버젼이 8.0.0 이 되어 이상하게 된 것 같습니다.일단은 버전을 드리는 것으로 해소합니다.
버전을 낮추려면 확장 프로그램 목록을 열고 pretier를 마우스 오른쪽 버튼으로 클릭하면 나타나는 Install Another Version에서 설치할 버전을 지정합니다.


마지막으로 확장 기능이 자동으로 업데이트되지 않도록 확장 기능 설정의 "..."를 누르면 표시되는 "Auto Update Extensions"를 "None"으로 둡니다.

Reference
이 문제에 관하여(vscode의 prettier에 cannot format 'xxxx'가 표시되고 포맷 할 수없는 문제를 해결하는 방법), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/allJokin/items/7f9d6f98be27449ab624텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)