강좌의 샘플 프로젝트 파일을 올려주시면 좋을 것 같아요.
따라 치면서 해보고 있는데, 오타 같은 부분으로 인해서 실제 실행하는데 있어 시간이 걸리는 부분이 있네요. ^^;
답변 2
0
강의 링크는 확인하였습니다. 감사합니다.
공유주신 내용으로 해도 안되네요;
> npm i typescript -g
> npm run start
...
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for
...
code: 'ERR_UNKNOWN_FILE_EXTENSION'
}
[nodemon] app crashed - waiting for file changes before starting...
0
package.json
{
"name": "sample",
"version": "1.0.0",
"description": "",
"main": "main.ts",
"type":"module",
"scripts": {
"start:build":"tsc -w --project tsconfig.json && npx -p tsconfig.json",
"build:live":"nodemon --watch 'src/**/*' --exec ts-node --esm src/main.ts --verbose",
"start":"npm run build:live"
},
"author": "",
"license": "ISC",
"dependencies": {
"fastify": "^4.26.0"
},
"devDependencies": {
"@types/node": "^20.11.16",
"nodemon": "^3.0.3",
"ts-node": "^10.9.2",
"typescript": "^5.3.3"
}
}
tsconfig.json
{
"compilerOptions": {
"module": "ES2022", /* Specify what module code is generated. */
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
"target": "ES2022", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
"moduleResolution": "Node", /* Specify how TypeScript looks up a file from a given module specifier. */
"outDir": "./dist", /* Specify an output folder for all emitted files. */
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
"noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
"isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
"strict": true, /* Enable all strict type-checking options. */
"noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
"useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
"inlineSourceMap": true /* Include sourcemap files inside the emitted JavaScript. */
},
"include": [
"src/**/*"
],
"exclude": [
"document",
"backup"
],
"ts-node":{
"esm":true,
"experimentalSpecifierResolution":"node"
}
}
npm start
[nodemon] 3.0.3
[nodemon] to restart at any time, enter `rs`
[nodemon] or send SIGHUP to 45444 to restart
[nodemon] watching path(s): 'src\**\*'
[nodemon] watching extensions: ts,json
[nodemon] starting `ts-node --esm src/main.ts`
[nodemon] spawning
[nodemon] child pid: 39804
[nodemon] watching 5 files
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts"
..
1
내용을 보니 'fastify 기본설정' 챕터를 진행중인걸로 예상되는데요
보내주신 설정파일 상으로는 아무 문제가 없는 것 같습니다.
그래서 몇가지 확인 부탁드리겠습니다.
typescript를 -g 즉 전역으로 설정 하셨는지에 대해 확인 부탁드립니다.
npm i typescript -g
다음 링크는 fastify 기본 설정 까지 테스트한 내용입니다. 다음 파일을 압축 풀고 npm i를 이용해 패키지 설치 후 실행해 보시기 바랍니다. 만약 작동한다면 해당 링크의 코드와 작성하신 코드를 비교해 보시기 바랍니다.
https://drive.google.com/file/d/1mrjpEHQhvXPxbgkEtHyV21txlpCFeOXJ/view?usp=drive_link
위의 사항을 확인 후에도 오류가 발생한다면 다시한번 문의 부탁드리겠습니다.
그리고 강좌의 샘플 코드의 경우 마지막 챕터에 링크가 있습니다. 이부분도 참고 하시기 바랍니다.
스프링부트 서버 에러나요
0
9
1
74. 데이터 캐시 - 1 (이론) 강의 영상 누락
0
11
1
2강 nodejs 3단계 설명 질문
0
23
1
useEffect와 lifecycle문의
0
23
2
Next.js 사전렌더링 이해하기 부분
0
22
2
프론트엔드 학습 수준 문의
0
31
2
useMutation 적용 후 새로운 글 등록시 content가 안보여요
0
32
2
적절한 타입 찾기 React.ChangeEvent<HTMLInputElemen>
0
25
2
모달 관련 질문
0
32
3
리액트 챕터별 코드에서 eslint 설정파일이 없어요
0
46
2
DDD 는 마이바티스와 잘 맞지 않는건가요?
0
44
1
스프링부트 버전 문의드립니다.
0
38
1
lucide react 아이콘 설치
0
39
2
prisma migrate 오류
0
179
3
401 not expired token 에러 메세지는 언제 쓰이나요?
0
269
2
Swagger 문서 접근 권한
0
235
1
앱에 refreshToken을 전송할때 궁금한점이 있습니다.
0
330
2
배포-ubuntu에서 문제
0
244
1
openssl 설치후 적용 안되요
0
357
1
comment 기능
0
193
1
섹션 5 login 인증 기능
0
335
2
Prisma 환경 설정 질문있어요!
0
247
2
TypeError 관련하여 문의드립니다.
0
293
1
똑같이 따라하고 오류나서 다시해보고 다시해보고 올려주신 코드 확인해봐도 계속 에러가 뜨는대요 ㅠ.ㅠ
0
802
1





