Node.js: Difference between revisions
Jump to navigation
Jump to search
Line 17: | Line 17: | ||
# Add repository -- adapt version as necessary: |
# Add repository -- adapt version as necessary: |
||
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - |
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - |
||
⚫ | |||
⚫ | |||
# ... |
# ... |
||
# ## Run `sudo apt-get install -y nodejs` to install Node.js 16.x and npm |
# ## Run `sudo apt-get install -y nodejs` to install Node.js 16.x and npm |
||
Line 27: | Line 25: | ||
# echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" | sudo tee /etc/apt/sources.list.d/yarn.list |
# echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" | sudo tee /etc/apt/sources.list.d/yarn.list |
||
# sudo apt-get update && sudo apt-get install yarn |
# sudo apt-get update && sudo apt-get install yarn |
||
⚫ | |||
⚫ | |||
</source> |
</source> |
||
Revision as of 23:02, 31 October 2021
Node.js is the open-source JavaScript runtime environment based on Chrome V8 engine and that can execute JavaScript code outside a web browser.
References
- https://nodejs.org/en/ — Node.js home (show current LTS version, and latest version).
- NVM — Node Version Manager, which allows to manage multiple released Node.js versions (to use version from source, see here).
Install
Install using distribution packages
The simplest is to install from apt:
sudo apt install nodejs npm
To install the latest version using apt, install Node.js repositories (nodesource, [
# Add repository -- adapt version as necessary:
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
# ...
# ## Run `sudo apt-get install -y nodejs` to install Node.js 16.x and npm
# ## You may also need development tools to build native addons:
# sudo apt-get install gcc g++ make
# ## To install the Yarn package manager, run:
# curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/yarnkey.gpg >/dev/null
# echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
# sudo apt-get update && sudo apt-get install yarn
# Install
sudo apt install nodejs
Install using NVM
See instruction on github.