use apt update nodejs on Ubuntu

简介: Use n module from npm in order to upgrade nodesudo npm cache clean -fsudo npm install -g nsudo n stablesudo ln -sf /usr/local/n/version...

Use n module from npm in order to upgrade node

sudo npm cache clean -f
sudo npm install -g n
sudo n stable
sudo ln -sf /usr/local/n/versions/node/<VERSION>/bin/node /usr/bin/node

To upgrade to latest version (and not current stable) version, you can use

sudo n latest

To undo:

sudo apt-get install --reinstall nodejs-legacy # fix /usr/bin/node
sudo n rm 6.0.0 # replace number with version of Node that was installed
sudo npm uninstall -g n

原文参考地址

目录
相关文章
|
网络协议 MySQL 关系型数据库
|
29天前
|
Ubuntu 网络协议 数据安全/隐私保护
【Ubuntu】sudo apt-get update 无法解析域名(亲测有效)
在Ubuntu 18.04系统中,用户在执行sudo apt-get update时遇到“无法解析域名‘ip’”的错误。经分析,问题源于之前设置的网络代理配置未完全清除。解决方案是找到并重命名/etc/apt/apt.conf.d下的proxy.conf文件,使其不再生效。操作后,sudo apt-get update命令恢复正常,问题得到完美解决。
66 4
【Ubuntu】sudo apt-get update 无法解析域名(亲测有效)
|
9月前
|
数据库连接
(node:2612) DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead.
(node:2612) DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead.
|
机器学习/深度学习 网络协议 决策智能
ubuntu16.04中 启动 Error starting userland proxy: listen tcp 0.0.0.0:5900: bind: address already in use
ubuntu16.04中 启动 Error starting userland proxy: listen tcp 0.0.0.0:5900: bind: address already in use
144 0
|
Ubuntu
sudo apt-get update出现W: GPG 错误:http://packages.ros.org/ros/ubuntu xenial InRelease: 由于没有公钥,无法验证下列签名:
sudo apt-get update出现W: GPG 错误:http://packages.ros.org/ros/ubuntu xenial InRelease: 由于没有公钥,无法验证下列签名:
319 0
sudo apt-get update出现W: GPG 错误:http://packages.ros.org/ros/ubuntu xenial InRelease: 由于没有公钥,无法验证下列签名:
|
域名解析 网络协议
【亲测有效】Ubuntu18.04 sudo apt update无法解析域名的解决方案
【亲测有效】Ubuntu18.04 sudo apt update无法解析域名的解决方案
3502 1
ubuntu16.04 update 18.04 cannot get the new version
ubuntu16.04 update 18.04 cannot get the new version
78 0
|
Ubuntu 网络协议 Linux
Linux - Ubuntu下执行apt-get update报错:Some index files failed to download. They have been ignored, or old ones used instead.
Linux - Ubuntu下执行apt-get update报错:Some index files failed to download. They have been ignored, or old ones used instead.
2211 0
Linux - Ubuntu下执行apt-get update报错:Some index files failed to download. They have been ignored, or old ones used instead.
|
Ubuntu 网络安全 开发工具
Ubuntu E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing? 错误
Ubuntu E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing? 错误
773 0
|
弹性计算 Ubuntu 网络安全
How to Install and Use Ansible on Ubuntu 16.04
In this tutorial, we will learn how to set up Ansible on an Alibaba Cloud ECS Ubuntu 16.04 instance.
2500 0
How to Install and Use Ansible on Ubuntu 16.04