package.json을 수정할 상황이 있어서 수정했다가 에러가 발생했다.
-> 특정 패키지를 package.json으로 삭제하고 yarn install으로 재설치하려던 상황...
-> 패키지 삭제는 패키지 매니저 명령어를 통해 하도록 하자.
error TS2688: Cannot find type definition file for 'mime'.
The file is in the program because:
Entry point for implicit type library 'mime'
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Error: Command "yarn run build" exited with 2
mime에 관려된 타입을 찾을 수 없다는 에러이다.
실패. 여전히 오류 발생
yarn add @types/mime --dev
로 mime 패키지를 설치해 타입 정의 파일을 설정해준다.실패. tsconfing.json 파일에서 mime의 타입에 대한 설정을 명시적으로 지정해줘야한다.
배포 성공.
"compilerOptions": {
...
"typesRoot": ["node_modules/@types"],
...
},
위 코드를 추가해준다.
yarn remove mime yarn add mime
로 재설치