How to Set Up a Node.js Project

Sdílet
Vložit
  • čas přidán 5. 06. 2024
  • Learn how to set up a Node.js project, run JavaScript code outside the browser, and use npm for package management! Code: thecodingtrain.com/tracks/dis...
    🚀 Watch this video ad-free on Nebula nebula.tv/videos/codingtrain-...
    💻 Github Repo: github.com/CodingTrain/node-p...
    🎥 Previous: • Workflow: Terminal, Sh...
    🎥 Next: • I made a Discord Bot t...
    References:
    📂 fs module: nodejs.org/api/fs.html
    📦 npm registry: www.npmjs.com/
    🐮 cowsay package: www.npmjs.com/package/cowsay
    🖼️ canvas package: www.npmjs.com/package/canvas
    🤖 Discord Bot Examples: github.com/CodingTrain/Discor...
    Timestamps:
    0:00 Introduction
    1:47 Running JavaScript code with Node
    3:04 Creating a Node project
    7:24 Using built-in Node modules
    11:51 Installing and using third party packages
    18:26 Working with existing Node projects
    24:02 Summary
    Editing by Mathieu Blanchette
    Animations by Jason Heglund
    Music from Epidemic Sound
    🚂 Website: thecodingtrain.com/
    👾 Share Your Creation! thecodingtrain.com/guides/pas...
    🚩 Suggest Topics: github.com/CodingTrain/Sugges...
    💡 GitHub: github.com/CodingTrain
    💬 Discord: thecodingtrain.com/discord
    💖 Membership: czcams.com/users/thecodingtrainjoin
    🛒 Store: standard.tv/codingtrain
    🖋️ Twitter: / thecodingtrain
    📸 Instagram: / the.coding.train
    🎥 Coding Challenges: • Coding Challenges
    🎥 Intro to Programming: • Start learning here!
    🔗 p5.js: p5js.org
    🔗 p5.js Web Editor: editor.p5js.org/
    🔗 Processing: processing.org
    📄 Code of Conduct: github.com/CodingTrain/Code-o...
    This description was auto-generated. If you see a problem, please open an issue: github.com/CodingTrain/thecod...
    #nodejs #javascript #nodejs

Komentáře • 85

  • @BIA_JOE
    @BIA_JOE Před 6 měsíci +34

    I’m so grateful. Don’t know if it’s me but it seems like you need to be born knowing what all of this stuff is, now that it is being explained to me I finally see light 🤩

    • @master74200
      @master74200 Před 6 měsíci +6

      You don't. You just spend a few weeks or months with various tools, and it'll rapidly be completely intuitive to you how everything would work. Learn some computer fundamentals, and your intuitive perspective will widen.

    • @anshswaroop6849
      @anshswaroop6849 Před 6 měsíci

      @@master74200 bro few weeks !!! I know it's not rocket science but it's not that easy if .

  • @patricioisaiascv
    @patricioisaiascv Před 6 měsíci +17

    Thanks for your amazing teaching, Daniel! I started creative coding in 2018 because of you. I'd love to enroll in ITP and meet you someday. Greetings from Chile! 😄

  • @Manticore_007
    @Manticore_007 Před 6 měsíci +1

    Thank you so much for teaching the basics! I couldn't find a decent video explaining what you need and what it does. Superb as always, and again; love the energy! I love watching you teach! ❤

  • @HeadmostCantaloupe
    @HeadmostCantaloupe Před 5 měsíci +1

    These videos are great Dan! it's so refreshing to see videos from you that are not related to processing or p5.js

  • @isaacbaptista6207
    @isaacbaptista6207 Před 6 měsíci +6

    Finaly a node.js tutorial where I actually learned something. Thank you.

  • @sajidhaniff01
    @sajidhaniff01 Před 6 měsíci +1

    Daniel! Thank you for your wonderful tutorials! Your energy and enthusiasm are infective!!

  • @geoffwagner4935
    @geoffwagner4935 Před 6 měsíci

    my favorite visual studio them i've had for months is "Outerspace Next" - alien invasion , much softer on the eye and colors are like candy. OceanDeeper was close but, it's much more conveniently and nicely colored on the other. i liked the ocean colors, but the text colors usually aren't as amazing to me.

  • @andrewdunbar828
    @andrewdunbar828 Před 6 měsíci

    Setupping them is easy on my set up. I setupped many of them.

  • @AurelioKessler
    @AurelioKessler Před 3 měsíci +1

    long time ago since i use nodejs and your video helped me to setup my project correctly. I don't remember a lot. 😂

  • @ColinTimmins
    @ColinTimmins Před 6 měsíci

    Thanks for all the videos. A discord bot sounds like a good project to learn from. =]

  • @mastermobo4554
    @mastermobo4554 Před 6 měsíci +2

    Soooo hyped that you are covering Node.js! Would you ever consider covering TypeScript in the future? Would love to see that!

  • @tylerbakeman
    @tylerbakeman Před 6 měsíci

    I love working in P5.js - it’s easy to use.
    P3 was my favorite IDE for casual Java development - P4 was my least favorite (P3 had a more professional look and feel - and all of my code broke during the transition).
    So, now I use Eclipse for everything (until I land a job where they probably use VisualStudio or some random unheardof IDE)

  • @Samuel-eg5wc
    @Samuel-eg5wc Před 6 měsíci +6

    How do you have so much knowledge for all these code-based programs? Im a first year cs major and seeing you explain every single thing you do so clearly makes me feel so dumb😭. Thank you so much for your videos. I never knew watching someone else code would be so entertaining.

    • @lucbian
      @lucbian Před 6 měsíci +1

      I'm a 3rd year CS major and I feel the same. The more we learn, the more we realise we know NOTHING!

    • @stio_studio
      @stio_studio Před 6 měsíci

      @@lucbian That is how coding works lol

    • @snakefinn
      @snakefinn Před 6 měsíci

      As a senior CS student I must say, we are just getting started

    • @Trizzi2931
      @Trizzi2931 Před 6 měsíci

      I am a masters student and i was feeling same when I was in third year. One thing i would suggest would be to use this knowledge and actually do something. Make projects it doesn’t have to be creative or anything like that just go ahead and make pne entire by yourself. Also form habit of reading docs after you have learned basic points. And last thing is try to learn linux I know it’s not directly related to nodejs but if you go into the job market, it’s one skill that everybody asks for. If you have macOS then no need to install anything else as it’s already an unix system but for windows I would recommend dual booting.

    • @master74200
      @master74200 Před 6 měsíci

      The knowledge just comes from experience. Trying shit. Building things. Do that for a few months and it'll be very intuitive.

  • @santicanog_
    @santicanog_ Před 6 měsíci

    Another great introduction to get up and running with The Conding 🚂. Mastery of teaching 💡💖

  • @ghazalehabadian6536
    @ghazalehabadian6536 Před 6 měsíci

    Great teacher

  • @__nicfit__
    @__nicfit__ Před 4 měsíci

    `rm -rf node-project` is the best approach.

  • @volodymyrselevertov
    @volodymyrselevertov Před 6 měsíci

    Your are amazing man

  • @k.6028
    @k.6028 Před 5 měsíci

    i would personally love to see you design a social media site with logins from scratch!

  • @juggernogking4829
    @juggernogking4829 Před 6 měsíci +2

    Thank you ❤

  • @faBi_292
    @faBi_292 Před 6 měsíci

    Need moreeeee :)

  • @lucasferrero123
    @lucasferrero123 Před 6 měsíci

    We missed you

  • @deltaforce3329
    @deltaforce3329 Před 6 měsíci

    Thank you !! i am the 3000 visitor !!

  • @dipendranath6429
    @dipendranath6429 Před 6 měsíci

    I love the way you explain things ❤❤

  • @Yazan_Majdalawi
    @Yazan_Majdalawi Před 6 měsíci

    I've been hesitating to learn Node.js but now I am 100% ready.

  • @user-ru8bq6vl5t
    @user-ru8bq6vl5t Před 6 měsíci +1

    非常棒

  • @ihsannuruliman4005
    @ihsannuruliman4005 Před 6 měsíci +1

    Dan will you make a series about machine learning (and data science in general) from scratch?
    Because the playlist about ML is basically about ML engineering. I thank you for that, but I want to see more. From the math and how to contruct the algorithm.

    • @delekmiller2362
      @delekmiller2362 Před 6 měsíci

      He made a neural networks series. It's great.

  • @cholo2605
    @cholo2605 Před 6 měsíci

    Wow, this was an amazing tutorial, i finally understand a lot of thing about node, thanks so much, Greetings from Rome!!!

  • @lomzart
    @lomzart Před 6 měsíci +1

    Hey hey, first thanks for all really you are the best! Please make a twitter bot that can post a canvas image as a post. Thanks❤‍🔥

  • @3zdayz
    @3zdayz Před 6 měsíci

    Renaming to mjs let's you mix cja and mjs files. It also differentiates it's a node module. Typically it's improbable that is files for node would also work in a browser

  • @spicymishka
    @spicymishka Před 6 měsíci

    Oh man we really could've used this 2 weeks ago for our IMA lowres Connections Lab projects but I guess hindsight 20/20

    • @TheCodingTrain
      @TheCodingTrain  Před 6 měsíci

      Oh! Hello IMA Low Res! I hope these videos help!

    • @spicymishka
      @spicymishka Před 6 měsíci

      Honestly I think watching these should be part of our homework! They're that good :)@@TheCodingTrain

  • @anon_y_mousse
    @anon_y_mousse Před 6 měsíci

    I decided to follow along with this one because I've never used npm or node for anything I've written. I have no idea if I installed node or if I'm using the one that came with Slackware, but apparently I'm on v20.0.0. One weird thing, I don't know if it's a bug in my version, but cowsay ignores the cow field. I tried importing SQUIRREL and it says it's not found. All the solutions suggested by node when it displayed the various error messages don't work, and I even tried just using "squirrel" and it gave no error and just used the standard cow.
    I figured I'd also make some suggestions of my own while I'm at it. Consider adding to your ~/.bashrc: mkcd() { if [ $# -ne 0 ]; then mkdir "$1"; cd "$1"; fi; } and alias ..='cd ..' alias ...='cd ../..' etc. And for a neat trick, cd - will take you to the immediately previous directory you were in, cd on its own will take you home.

  • @robw3000
    @robw3000 Před 6 měsíci

    After 20 years .NET I had to move over to node.js. Your video's helped a lot! Great teacher!

  • @caryrabbit
    @caryrabbit Před 6 měsíci

    Watching this makes me so happy I started with Python. What an over complicated language. Still very interesting.

    • @master74200
      @master74200 Před 6 měsíci

      Python is also very complicated, but in different ways. And in the same ways too. Dynamically typed languages are very complicated though, I do agree.

    • @letsgocamping88
      @letsgocamping88 Před 5 měsíci

      This is hardly different to python and pip? The only thing I'm seeing different is project structure?

  • @geoffwagner4935
    @geoffwagner4935 Před 6 měsíci

    I was wanting a small collection or drones, i think i want a small collection of Raspberry pi after all the Dan's node and express stuff xD

  • @zheil9152
    @zheil9152 Před 6 měsíci

    For anyone watching this to learn and get started with JS in any serious capacity in the future, do yourself a favor and use typescript. It makes your life a thousand times easier and your coworkers one day will thank you.

    • @supercrafter100
      @supercrafter100 Před 6 měsíci

      Everyone’s gotta start somewhere. I personally learned to code with js and later learned ts!

  • @hillolbarman
    @hillolbarman Před 6 měsíci

    I would really like to know if there is way to use p5 in node/react project. Where all the position calculations and maths of the animation is done separately and draw functions independently renders the updated values at a constant framerate. An example would be great too.

    • @lucbian
      @lucbian Před 6 měsíci

      Yes there is. There's a good amount of info online on how to do it.

    • @hillolbarman
      @hillolbarman Před 6 měsíci

      @@lucbian Could you please share a repo or blog? Thanks.

    • @DipamSen
      @DipamSen Před 6 měsíci

      Do you mean using it in node (on the server, eg. For generating images), or using it with a client sida framework like react (same function as p5.js in the browser, just in the context of a framework)

    • @hillolbarman
      @hillolbarman Před 6 měsíci

      @@DipamSen Both

  • @prasitsingh6713
    @prasitsingh6713 Před 5 měsíci

    After running these 2 commands I still cant get node_modules folder
    npm init -y npm install
    Why is it like that? I’m stuck here for 3 weeks. Please help
    But when i download someone else project and run the same commands it creates node_modules folder

  • @wrt3778
    @wrt3778 Před 3 měsíci

    Sir, you are the best, thank you.

  • @sanveersingh3513
    @sanveersingh3513 Před 6 měsíci

    I'm learning JS, but a lot of projects rely on third party libraries, If I install then vulnerability list going up, if I do audit fix then project dont run any advise

    • @supercrafter100
      @supercrafter100 Před 6 měsíci +1

      The vulnerabilities ideally should be fixed by the authors of libraries you're using. There isn't really much you can do yourself. Either use different libraries or just live with the fact that they're there. Often these vulnerabilities aren't really that severe but it's obviously ideal if there are none.

    • @master74200
      @master74200 Před 6 měsíci

      Try to do what you need to without a library. It's not easy, but you can do it. Keep doing that, and you'll see that most packages aren't needed at all.

  • @pannasstuff1466
    @pannasstuff1466 Před 3 měsíci

    lol @detective work🤣

  • @kebro135246
    @kebro135246 Před 6 měsíci

    Are you gonna make a video about the correct way to make an MVC NodeJS server? 🙏🤩

    • @TheCodingTrain
      @TheCodingTrain  Před 6 měsíci +1

      I don't write a lot of "correct" code 😂 Are these videos what you are looking for? thecodingtrain.com/tracks/data-and-apis-in-javascript/data/2-data-selfie-app/1-server-side-with-node-js

  • @juanmacias5922
    @juanmacias5922 Před 6 měsíci

    Bun with TS, when? :D

  • @CuttDaMuzik
    @CuttDaMuzik Před 5 měsíci

    I just wanna know when you launching a project

  • @geoffwagner4935
    @geoffwagner4935 Před 6 měsíci

    i made a third database with username, password, and a messenger page yesterday that put the user in the message on my node express yesterday

  • @loic.bertrand
    @loic.bertrand Před 6 měsíci +3

    3:47 Is this a joke from the npm team or is this real ? 😆

  • @TheSteveMorganShow
    @TheSteveMorganShow Před 6 měsíci

    Not sure why it keeps telling me type error cowsay.say is not a function when trying to run it.

    • @TheCodingTrain
      @TheCodingTrain  Před 6 měsíci

      hmmmm, are you in the discord to maybe post your code / error screenshots?

    • @TheSteveMorganShow
      @TheSteveMorganShow Před 6 měsíci

      Gonna try on my Windows machine as the other was on my mac@@TheCodingTrain

    • @TheSteveMorganShow
      @TheSteveMorganShow Před 6 měsíci

      panic over i updated Node and re npm cowsay and all working now on mac after testing went all ok on PC@@TheCodingTrain

  • @MailDeliverySystem-xw6hh
    @MailDeliverySystem-xw6hh Před 6 měsíci

    No Bun intended ?

  • @AndyNotSoSmart
    @AndyNotSoSmart Před 4 měsíci

    🚅

  • @geoffwagner4935
    @geoffwagner4935 Před 6 měsíci

    *ring a ling a ling*

  • @vikingthedude
    @vikingthedude Před 6 měsíci

    Thank you for refusing to name files with .mjs

  • @geoffwagner4935
    @geoffwagner4935 Před 6 měsíci

    utter non sense

  • @rizgamingvids
    @rizgamingvids Před 6 měsíci

    Hey, I am back with you. I have been waiting for your contents, Sir.