Installing Node.js on different platforms:
- Download the Windows installer from the Node.js website.
- Run the installer (the
.msi
file you downloaded in the previous step.) - Follow the prompts in the installer (Accept the license agreement, click the NEXT button a bunch of times and accept the default installation settings).
- Make sure you check the Add to PATH option. It should be selected by default. If you don't select this option, you'll have to update your
PATH
environment variable manually to runnode
from the command line. - You can install the optional tools, but they're not required for this course.
- Click the install button, and wait for the installation to complete. ! Install
- Open a new command prompt/powershell and verify that Node.js was installed correctly by running the following commands:
node -v
&npm -v
.You should see something like this, but with a different version number:
- You're done! You can now use
node
andnpm
from the command line.
- Download the Mac installer from the Node.js website.
- Run the installer (the
.pkg
file you downloaded in the previous step.) - Follow the prompts in the installer (Accept the license agreement, click the continue button a bunch of times and accept the default installation settings).
- Wait for installation to complete.
- Open a new terminal and verify that Node.js was installed correctly by running the following commands:
node -v
&npm -v
.You should see something like this, but with a different version number:
- You're done! You can now use
node
andnpm
from the command line.
- Download the Linux installer from the Node.js website.
- Open a terminal and navigate to the directory where you downloaded the file.
- Unpack the file using the tar command:
tar -xvf node-v16.18.0-linux-x64.tar.xz
(wherenode-v16.18.0-linux-x64.tar.xz
is the name of the file you downloaded). - Copy the extracted folder to the
/usr/local
directory:sudo cp -r node-v16.18.0-linux-x64 /usr/local/
. - Add the
bin
directory of the newly created folder to thePATH
environment variable:export PATH=/usr/local/node-v16.18.0-linux-x64/bin:$PATH
. - Open a new terminal and verify that Node.js was installed correctly by running the following commands:
node -v
&npm -v
.You should see something like this, but with a different version number:
- You're done! You can now use
node
andnpm
from the command line.