5 ms·
Replace '10' if you want another version: curl -sL https://deb.nodesource.com/setup_10.x https://deb.nodesource.com/setup_10.x | sudo -E bash - sudo apt-get i
by nailer 7y ago
Replace '10' if you want another version:
curl -sL https://deb.nodesource.com/setup_10.x https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs
- ronjouch 7y agoBetter to point people at the official instructions, to give them context about the thing you suggest them to sudocurl: https://github.com/nodesource/distributions#debinstall https://github.com/nodesource/distributions#debinstall . Installation nit aside, nodesource is my preferred way to upgrade node on Debian/Ubuntu: 1. It's "just a newer version" of the OS-packaged version! As simple/vanilla as can be. 2. No shell magic making it unclear whether programs running out of the shell will pick up your nvm-managed version of node (most of the time, they won't) 3. And if someday I need to try something on $OLDNODE, it's not much less convenient than nvm: I can just download the deb for $OLDNODE and install it anytime. Then, if you configure your apt cache to keep .debs in /var/cache/apt, switching between versions like nvm does is a matter of just running `sudo dpkg -i /var/cache/apt/node-whatever.deb`. (Sure, it's a bit slower than nvm: a few seconds of install rather than milliseconds of updating a symlink in nvm; still I prefer it for reasons 1. and 2.)