~/.bash_profile
or create a new one if the ~/.bash_profile
file does not exist. Make sure you add source ~/.bashrc
in the file and save.nvm
was installed successfully.nvm: command not found
or no feedback, close your terminal and open a new terminal and enter the nvm --version
again. If you using ssh to access linux, you might need to restart your session.nvm
command not working, check out this linknode -v
. It will display the current Node.js version.npm -v
to display the current npm version.node
in the terminal.>
sign is there to let you know that the code entered will be immediately evaluated when you press enter..exit
or press CTRL+D
once. You can also exit out by pressing CTRL+C
twice..js
and run it in the terminal using the node
command.node.js
in our home directory.mkdir
is a command used for creating directoriesnodejs
directory.node.js
directory.first-program.js
. For simplicity’s sake, we will use Nano which is a terminal text editor.first-program.js
in the Nano editor.enter
to save the file.CTRL+X
.first-program.js
: