How to Setup Node.js with TypeScript in 2023

How to Setup Node.js with TypeScript in 2023

Beyond Fireship

1 год назад

377,420 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

MistyMu
MistyMu - 21.09.2023 18:52

Setting up a JS/TS environment is the worst. Python is pretty bad too. Especially setting up tests, linting and everything else that goes into maintaining a large project. Compare that to other environments like GoLang (go mod init project_name), Kotlin (IntelliJ already comes with Gradle and JUnit), Swift (project is good to go in Xcode), Rust (cargo new project-name) etc. No need to install hundreds of node modules and configure VS Code to do linting etc. It is especially helpful with Coding Katas and introducing people to coding and things like TDD.

Ответить
Pranav
Pranav - 21.09.2023 16:52

This video was killed by Bun

Ответить
Crystal Cortex
Crystal Cortex - 19.09.2023 22:48

Hello, I am using node JS and I am trying to use ECMA script with both js and TS files. I have set in my package.json "type: module", but when it fails to build with the output: "unknown file extension TS"

Ответить
Family stuff
Family stuff - 18.09.2023 17:51

How you create tsconfig file

Ответить
Srinivas Nahak
Srinivas Nahak - 16.09.2023 23:46

You're a magician for sure!!

Ответить
Labham Jain
Labham Jain - 12.09.2023 22:23

This video is obsolete now since everyone is gonna jump to either deno or bun 😂

Ответить
Diego Ramirez Guerrero
Diego Ramirez Guerrero - 01.09.2023 19:35

I am getting my errors in javascript code although I have sourcemap set to true. How could i fix that?

Ответить
Sa Na
Sa Na - 01.09.2023 16:39

tsconfig.json file

{
"compilerOptions": {
"module": "Node",
"moduleResolution": "Node",
"target": "ES2020",
"sourceMap": true,
"outDir": "dist",
},
"include": ["src/**/*"],
}

Ответить
nightwish15
nightwish15 - 25.08.2023 03:30

This is amazing. Thank you :)

Ответить
Petar Kostadinov
Petar Kostadinov - 20.08.2023 15:49

Exactly what I needed . Perfect video!

Ответить
Mystic Robo
Mystic Robo - 09.08.2023 19:12

Why not just use ts-node, it works and it seems like a waste of time to be configuring this instead of solving your actual problem

Ответить
Alejandro Torres Hernandez
Alejandro Torres Hernandez - 07.08.2023 06:04

This is the first try I gave to typescrtipt and I can't import my own modules. It does not matter what I do, it keeps giving me the same error: "Cannot find module". Why is so stupid hard to start a project with this tool?

Ответить
phaZZi
phaZZi - 01.08.2023 14:40

i was here for the module thing, thanks

Ответить
GreggsWorld
GreggsWorld - 26.07.2023 19:55

Still get an error when wanting to build :( - "This is not the tsc command you are looking for"

Ответить
Wilfred Almeida
Wilfred Almeida - 21.07.2023 14:53

How to build a project with this config? It's not generating JS code. I tried some stuff but it errors.

Ответить
Monzer Faisal
Monzer Faisal - 10.07.2023 22:14

How is this a purposely done thing in today's day and age?

Ответить
Glenn Dollard
Glenn Dollard - 06.07.2023 10:33

Great info but slow down!!

Ответить
flatmapper
flatmapper - 29.06.2023 22:17

Love it! Looking forward to watching your full course. But please do it for experienced developers too

Ответить
flatmapper
flatmapper - 29.06.2023 22:06

Thank you so much!

Ответить
Edhar Ezenva Avuzi
Edhar Ezenva Avuzi - 29.06.2023 22:04

Thank you so much!

Ответить
D-land Arrese
D-land Arrese - 08.06.2023 06:50

Excellent tutorial!

Ответить
Web Developer
Web Developer - 03.06.2023 17:27

you saved my hairline

Ответить
Ali Hamza
Ali Hamza - 02.06.2023 21:11

Noobalert.

Do you install typescript globally or per project?

Ответить
Moises Garcia Marquez
Moises Garcia Marquez - 26.05.2023 07:59

NodeJs support for TypeScript is a joke, and not a good one. After all these years one might think that something as basic as that should already be covered... but nope.

Ответить
Chen Lim
Chen Lim - 14.05.2023 04:47

Thanks for this! Setting up a new Node project in 2023 is:
1 hour setting up the build environment
1 hour setting up linting
1 hour getting webpack to work
1 more hour optimizing everything
3 hours researching Deno / Bun / Vite, then deciding it's not worth it
1 hour wondering if you're better off with plain JS
1 hour remembering what you wanted to build

Ответить
Marty Bando
Marty Bando - 10.05.2023 07:55

So nodeTs?

Ответить
Aaronbcj
Aaronbcj - 08.05.2023 14:05

time to change package.json to package.tson

Ответить
User
User - 04.05.2023 12:04

Firebase, typescript, zod, no more error 🎉

Ответить
Abhay Nath
Abhay Nath - 03.05.2023 16:31

Madness....... ?




THIS IS JavaScript ecosystem 🔥🔥🔥🔥🔥🔥

Ответить
SomeRandomGuy
SomeRandomGuy - 26.04.2023 14:35

If you guys are getting this error after setting up the tsconfig

error TS18003: No inputs were found in config file 'D:/abc/xyz/tsconfig.json'. Specified 'include' paths ORK/suman ap
were '["src/**/*"]' and 'exclude' paths were '["dist"]'.

add this to your ts congif

"include": ["src/**/*", "**/*.ts"],

and run npm run build again, it should work fine

Ответить
Volbla
Volbla - 25.04.2023 14:17

People keep saying i should use ts instead of js. This bag of nonsense is why i don't.

Ответить
Nomad SWE
Nomad SWE - 25.04.2023 03:13

Do the course in strict:true mode pls.

Ответить
John Pfannkuchen
John Pfannkuchen - 17.04.2023 16:54

Setup is a noun. Set up is a verb (phrase). You cannot setup anything. But you can set something up.

Ответить
Manas
Manas - 12.04.2023 18:06

Guys what happened, who's responsible for this, what happened, why did y'all let this happen, and fucking who's responsible for this clusterfuck of an ecosystem

Ответить
Wilfred Pichardo
Wilfred Pichardo - 07.04.2023 00:13

It's truly a peculiar experience see how this channel's owner is gradually descending into madness by the hand of web technologies mostly.

I just can't look away... keep the hard work

Ответить
bluescorpian519
bluescorpian519 - 05.04.2023 01:28

exactly what I needed, thanks.

Ответить
Rundik
Rundik - 24.03.2023 21:41

Adding ".js" is a hack. I was hoping this tutorial shows how to do it properly

Ответить
Nithin Raj
Nithin Raj - 24.03.2023 10:15

Thank You

Ответить
Novacification
Novacification - 19.03.2023 04:29

Could you go over some scenarios for building and publishing. For instance, I'm creating a base server implementation (basically an express wrapper with auth middleware) and I would like to publish it to a local npm registry (Verdaccio).
It publishes everything, not just the dist folder, and I'm not sure how to handle dependencies.
I have some issues with importing the server package as well, needing to do a second deconstruction of the default export for the dependency.
A good up to date minimal setup for building and publishing would be really cool! Something with build to dist, publish from dist and importing the package somewhere (maybe even with import instead of require)

Ответить
Saiyaman93
Saiyaman93 - 07.03.2023 00:22

If instead "include": ["src/**/*"] you do "include": ["src/server/**/*"] and you create directory src/server/<*.ts files here> it does not work.
So i decided to do 1:1 as video, getting error TS6046, aparently NodeNext is not recognized.
This JS ecosystem is nightmare, 3 month old video is outdated already? Every fking time. There is not a single UT video which you can follow step by step to setup JS stuff because every fucking minute there is new version, new framework, new way of doing stuff and old way of doing things doesnt work. Every video is deprecated before YT manages to process it.

Ответить
Northern Canuck
Northern Canuck - 06.03.2023 21:00

I spent 3 hours on fixing this. Thank you so much.

Ответить
Netify
Netify - 06.03.2023 18:37

Thanks for the tutorial. JS/TS mix ES/CommonJS in node just sucks. Always getting into some troubles while importing various modules. Tried several settings (with type module and without and nothing works 100% time). And importing JS while typing TS looks just weird. Any option to to bypass it? Your Sepukku joke is not far from truth bro, lol.

Ответить
Samyar
Samyar - 05.03.2023 17:20

evey once in a while i come back and watch this video

Ответить
arsnakeheart
arsnakeheart - 18.02.2023 21:10

This actually sucks ass, as I try to learn TypeScript I just want to start a goddamn npm project and start typing code, not having to configure all this by hand

Goddamn, I hate programming sometimes

Ответить
Steve Richter
Steve Richter - 17.02.2023 02:49

was hoping you would cover how to run the equivalent of nodemon when a change is made to the typescript source code.

Ответить
אלעד ר
אלעד ר - 13.02.2023 15:12

Excellent!

Ответить
Даня Хмельницкий
Даня Хмельницкий - 11.02.2023 07:53

What is the name of the theme for folders in this video?

Ответить