Node.js makes use of an event-driven, non-blocking I/O fashion that makes it light-weight and environment friendly, best for data-intensive real-time programs that run throughout disbursed gadgets.
Install Node.js on Debian
You can set up Node.js the use of NodeSource, NVM, and Debian repository. So, observe any one of the most strategies you suppose is more straightforward to put in Node.js.
You would possibly wish to set up the curl bundle prior to continuing additional.
sudo apt replace && sudo apt set up -y curl
Install Node.js the use of NodeSource
At the time of writing this text, the underneath variations of Node.js is to be had for consumer. You can discuss with the professional web page to search out the supported Node.js variations.
- v14.x (Active LTS)
- v12.x (Maintenance LTS)
- v16.x (Latest Version)
curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash - sudo apt set up -y nodejs
curl -fsSL https://deb.nodesource.com/setup_12.x | sudo -E bash - sudo apt set up -y nodejs
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash - sudo apt set up -y nodejs
Install Node.js the use of NVM
nvm is a model supervisor for Node.js, and it is helping us set up Node.js consistent with consumer and invokes it consistent with shell. Also, it lets you set up and use a couple of variations of node.js in parallel.
nvm through working the underneath command.
curl -o- https://uncooked.githubusercontent.com/nvm-sh/nvm/v0.38.0/set up.sh | bash
Once the nvm is put in, go out the present consultation and log in again to make use of the
Use the underneath command to make sure the
nvm set up.
Now, you’ll be able to use the
nvm command to put in the newest strong model of Node.js, the newest LTS model, a selected model of Node.js.
# Latest Stable Version nvm set up node # Latest LTS Version nvm set up --lts # Specific Version nvm set up 12.22.5
nvm ls-remote to checklist the to be had Node.js model to put in,
nvm use node/--lts/ to modify to every other Node.js model,
nvm alias default to set the default Node.js model.
Install Node.js the use of Debian Repository
Node.js could also be to be had within the Debian repository, and you’ll be able to set up it along side npm (Node Package Manager)the use of the underneath command.
Node.js v12.x (LTS) and npm v7.5.x are to be had within the Debian OS repository when writing this text.
sudo apt set up -y nodejs npm
Check Node.js Installation
Check the Node.js model the use of the next command.
Output: (NodeJS v14.x)
Check the npm model.
Install Build Tools
You will wish to set up building gear to collect and set up local addons from npm.
sudo apt set up -y build-essential