강좌의 샘플 프로젝트 파일을 올려주시면 좋을 것 같아요.
따라 치면서 해보고 있는데, 오타 같은 부분으로 인해서 실제 실행하는데 있어 시간이 걸리는 부분이 있네요. ^^;
답변 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
위의 사항을 확인 후에도 오류가 발생한다면 다시한번 문의 부탁드리겠습니다.
그리고 강좌의 샘플 코드의 경우 마지막 챕터에 링크가 있습니다. 이부분도 참고 하시기 바랍니다.
존재하지 않는 일기 url입력 시 alert이 두 번 떠요
0
6
0
교재(3쇄)와 강의 내용 문의
0
28
2
코드 질문
0
21
1
call stack 표현이 잘못표현된것이 아닌가요?
0
60
2
전자책으로 구매인증 가능할까요?
0
72
1
이제 인프런에서 강의 더 안산다. 후져....
0
42
1
소스코드 어디서 다운받아요?
0
52
5
4주차 미션 게시판이 안보여요~
0
46
2
eas 빌드가 엄청 오래걸려서..
0
59
2
수강완료 후 문의 드립니다.
1
47
2
27강 Context내 RSC 사용 관련 문의
0
82
3
혹시 다음 강의 제작 예정된 것들이 있을까요?
0
78
1
에러 질문드립니다
0
63
2
prisma migrate 오류
0
205
3
401 not expired token 에러 메세지는 언제 쓰이나요?
0
296
2
Swagger 문서 접근 권한
0
256
1
앱에 refreshToken을 전송할때 궁금한점이 있습니다.
0
351
2
배포-ubuntu에서 문제
0
254
1
openssl 설치후 적용 안되요
0
374
1
comment 기능
0
198
1
섹션 5 login 인증 기능
0
343
2
Prisma 환경 설정 질문있어요!
0
253
2
TypeError 관련하여 문의드립니다.
0
304
1
똑같이 따라하고 오류나서 다시해보고 다시해보고 올려주신 코드 확인해봐도 계속 에러가 뜨는대요 ㅠ.ㅠ
0
816
1





