금일 달성 항목
1) 코딩알려주는 누나 타입스크립트 강의 듣기
2) 후발대 강의 수강 (테스트 코드)
문제 해결 과정 1 - error TS18003
[문제]
cmd + shift + B 를 하면 tsc:build라는 것이 뜨는데 그걸 실행하면
error TS18003: No inputs were found in config file '/Users/hyerim/typescript/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '["./"]'.
오류가 자꾸 뜨는 현상이 나타났습니다.
[시도]
{ tsconfig.json } 제대로 알고 사용하기
tsconfig.json을 왜 그리고 무엇을 위해서 설정하는지 알아보고자 한다.
velog.io
https://github.com/Microsoft/TypeScript/issues/17155
error TS18003: No inputs were found in config file 'tsconfig.json'. Specified 'include' paths were '["src/**/*"]' and 'exclude'
can't parsing tsconfig.json error TS18003: No inputs were found in config file 'tsconfig.json'. Specified 'include' paths were '["src/**/*"]' and 'exclude' paths were '["node_modules"]'. tsconfig.j...
github.com
등등 다양하게 진입하여 시도해보았지만 해결이 안되었습니다.
[해결]
튜터님과 문구를 확인해보니 jscofing.json 의 include 와 exclude가 모두 전역으로 설정되어있어서 생긴 문제였습니다.
코딩알려주는 누나의 강의에서는 include와 exclude가 설정되어있지 않았고 실행했을때 기본값인
{
"compilerOptions": {
"outDir": "./", //js파일 아웃풋 경로바꾸기
"target": "es6", // 'es3', 'es5', 'es2015', 'es2016', 'es2017','es2018', 'esnext' 가능
"module": "commonjs", //무슨 import 문법 쓸건지 'commonjs', 'amd', 'es2015', 'esnext'
"lib": ["ES6"],
"sourceMap": true
},
"include": ["**/*"],
"exclude": ["./"]
}
"include": ["**/*"],
"exclude": ["./"]
이 실행되어 나타나는 현상이었습니다.
아래와 같이 include와 exclude 모두 다른 파일로 각각 설정해주니 tsbuild가 잘 생성되었습니다.
{
"compilerOptions": {
"outDir": "./", //js파일 아웃풋 경로바꾸기
"target": "es6", // 'es3', 'es5', 'es2015', 'es2016', 'es2017','es2018', 'esnext' 가능
"module": "commonjs", //무슨 import 문법 쓸건지 'commonjs', 'amd', 'es2015', 'esnext'
"lib": ["ES6"],
"sourceMap": true
},
"include": ["src"],
"exclude": ["./test"]
}
[알게된 점]
챗 gpt에 물어봐도 빨리 해결 할수 있었을 것 같다고 하셔서 다음부터는 챗 gpt로 적극적으로 사용할 예정입니다.
'혼자 고민해보기_ 개발 > TIL (Today I Learned)' 카테고리의 다른 글
20230714(금)_ 프로그래머스 공부, 뉴스피드 프로젝트 주석달기 (0) | 2023.07.14 |
---|---|
20230713(목)_ typescript 공부, js 보충특강 수강 (0) | 2023.07.13 |
20230711(화)_ 노드 JS 심화 과제 보충 (0) | 2023.07.11 |
20230710(월)_ 노드 JS 심화 Lv5 과제 완료 (1) | 2023.07.10 |
20230707(금)_ 노드 JS 심화 Lv4 과제 보완 (0) | 2023.07.07 |