![]() You can see that it will log Hello Node.js! to the terminal. Let's run the program! To execute your Node.js file, go back to your command line terminal and navigate to the directory in which you've saved the index.js file. Once you’re done with that, write your first line of Node.js: // File: index.js Open up your IDE ( Atom, Sublime, VS Code, or WebStorm), create a new file and save it with the name index.js. ![]() ![]() Let's start by creating a file called index.js. ![]() Now that your Node.js is up and ready to be put to use, we can write and run a small test program, to make sure that you're ready for the next part. If you've installed multiple versions using nvm, you can switch between them using the nvm use command: nvm use 12.14.0 If everything is working, it should say 12.14.0. This will return the version number of the currently active Node.js binary. To check if the chosen node version has been installed properly, run: node -version I usually choose to install one of the LTS (Long Term Support) versions, which are proven to be stable and have all the latest bug fixes.įor this tutorial, we'll install version 12.14.0 (LTS: Erbium). This is going to give you a long list of available Node.js versions. To list the versions of Node.js available to install, run the following command: nvm ls-remote The windows version requires you to Download and Install the executable from the nvm-windows GitHub repository. Here's how to install it for your specific operating system:įollow the steps specified in the nvm GitHub repository, or run the following command in your command line Terminal: curl -o- | bash If you want to add more Node.js versions to use for different applications, or to simply keep your Node.js environment organized, I'd recommend installing nvm. However, if you want to do it the right way, keep reading to learn about nvm. If you want to get started right away, download and install the Node.js binaries by visiting the official Node.js Downloads page. It'll be quite a beautiful journey, I assure you! Since you're reading this, I assume you've decided that Node.js is worth learning. In the first part of the Node.js Tutorial series, you've learned what Node.js is and why you should learn it. In this tutorial you'll learn how to install it using nvm, the Node Version Manager. Installing Node.js is very straightforward.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |