unbuntu安装Node.js
先删除这些
rm -rf ~/.npm
rm -rf ~/.npm-global
rm -rf ~/.npmrc
rm -rf ~/.node-gyp
按https://github.com/nodesource/distributions/blob/master/README.md#debinstall
安装
curl -sL https://deb.nodesource.com/setup_13.x | sudo -E bash -
sudo apt-get install -y nodejs
npm uninstall -g @angular/cli
npm cache clean --force
sudo apt remove nodejs
如果新安装的mint新版本,比如19.2 19.3... node会提示操作系统不支持
形如:

,那么参考https://github.com/nodesource/distributions/issues/881
1 下载nodejs_install.sh
wget -O nodejs_install.sh https://deb.nodesource.com/setup_13.x
2
xed ./nodejs_install.sh
在文件靠后的地方,找到mint
check_alt "Linux Mint" "tara" "Ubuntu" "bionic"
check_alt "Linux Mint" "tessa" "Ubuntu" "bionic"
加一行
check_alt "Linux Mint" "tara" "Ubuntu" "bionic"
check_alt "Linux Mint" "tessa" "Ubuntu" "bionic"check_alt "Linux Mint" "tricia" "Ubuntu" "bionic"
形如

然后 保存退出
sudo bash ./nodejs_install.sh
就可以 安装了
sudo apt-get install -y nodejs
参考这个修改npm路径,以便用-g安装包的时候不报错
Make a directory for global installations:
mkdir ~/.npm-global
Configure npm to use the new directory path:
npm config set prefix '~/.npm-global'xed ~/.profileOpen or create a
~/.profilefile and add this line:export PATH=~/.npm-global/bin:$PATH
Back on the command line, update your system variables:
source ~/.profile
添加 PATH="$HOME/.npm-global/bin:$PATH"
再安装angular就不用sudo了
先确认安装了
sudo apt install build-essential
如果不行,就
sudo -i
aptitude install g++
否则sass编译不过,提示没有g++
npm install -g -f @angular/cli
应对被墙, 装nrm
npm i nrm -g
然后用
nrm ls 列出代理
nrm use XXX 切换代理
安装phantomjs
sudo apt-get install phantomjs
安装typescript
npm i -g typescript
查看版本
ng --version

看见Angular: ...应该是安装正确的.
否则会看见error (8.x的node如果没卸载干净安装9 会提示 ts错误)
安装vscode https://code.visualstudio.com/docs/setup/linux
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
sudo install -o root -g root -m 644 microsoft.gpg /etc/apt/trusted.gpg.d/
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'
sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install code # or code-insiders
unbuntu安装Node.js的更多相关文章
- 在Linux Mint上安装node.js和npm
1.安装Node.js 前端开发过程中,很多项目使用npm的http-server的模块来运行一个静态的服务器,我个人在Dell的笔记本上安装的是Linux Mint最新版本,所以想尝试一下在Linu ...
- ubuntu kylin 14.04安装Node.js和Famous
默认使用软件中心安装node.js,然后参考https://famo.us/install进行安装 1.sudo apt-get install git 2.npm install -g yo gru ...
- centos 6.5安装node.js
1.检查是否安装gcc编译器 rpm -q gcc rpm -q gcc-c++ 2.如果没有安装则通过以下代码安装gcc编译器 yum -y install gcc-c++ kernel-devel ...
- [译]How to Install Node.js on Ubuntu 14.04 如何在ubuntu14.04上安装node.js
原文链接为 http://www.hostingadvice.com/how-to/install-nodejs-ubuntu-14-04/ 由作者Jacob Nicholson 发表于October ...
- Linux 安装node.js ---- 源码编译的方式
一 : 普通用户: 安装前准备环境: 1.检查Linux 版本 命令: cat /etc/redhat-release 2.检查 gcc.gcc-c++ 是否安装过 命令: rpm -q gcc rp ...
- CentOS 6 中安装Node.js 4.0 版本或以上
如果想在CentOS 6 中安装Node.js >4.0,如果通过以往的方式安装: wget http://nodejs.org/dist/v4.0.0/node-v4.0.0.tar.gz t ...
- Nodejs学习笔记(一)--- 简介及安装Node.js开发环境
目录 学习资料 简介 安装Node.js npm简介 开发工具 Sublime Node.js开发环境配置 扩展:安装多版本管理器 学习资料 1.深入浅出Node.js http://www.info ...
- 1. windows环境安装Node.js
1. 下载 地址: https://nodejs.org/en/ 2. 下载最新版本v6.1.0 Currrent
- 安装node.js+express for win7的Web开发环境配置
1.安装 node.js. 进入官网的下载地址:http://www.nodejs.org/download/ . 选择Windows Installer或者选择Windows Installer ( ...
随机推荐
- Docker学习笔记之常用的 Docker Compose 配置项
0x00 概述 与 Dockerfile 一样,编写 Docker Compose 的配置文件是掌握和使用好 Docker Compose 的前提.编写 Docker Compose 配置文件,其本质 ...
- win10常见问题处理办法
1.当笔记本连接wifi时,提示,无internet,安全,而手机能正常连接wifi时: cmd(需管理员权限)执行命令 netsh winsock reset 出现已重置,重启电脑 解决方法 2.当 ...
- 通过注册表regedit对Windows回收站进行恢复
误删资料恢复 一不小心,删错了,还把回收站清空了,咋办啊? 只要三步,你就能找回你删掉并清空回收站的东西 步骤: 1.单击"开始——运行,然后输入regedit(打开注册表) 2.依次展开: ...
- Python语言知识总结
1. 环境 1.1 Anaconda 抛弃python原生安装方式吧,使用Anaconda才是最省心的. 1.2 Miniconda Anaconda 太大了,Miniconda才是王道!下载链接:h ...
- Android之udp传输
注意除了添加Internet权限外,还要添加两行代码 StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder().detectDi ...
- Javascropt-KeyCode
当点回车时触发搜索事件 $(document).keydown(function (e) { if (e.keyCode == 13) { ...
- ldap集成grafana
grafana版本: 5.0.3 grafana通过k8s方式安装,所以需将配置文件挂载过去. cat grafana-configmap.yaml apiVersion: v1 kind: Conf ...
- Python3基础 访问在线的有道词典
Python : 3.7.0 OS : Ubuntu 18.04.1 LTS IDE : PyCharm 2018.2.4 Conda ...
- Vue学习【第二篇】:ES6简单介绍
ECMAScript 6简介 ECMAScript 6.0(以下简称 ES6)是 JavaScript 语言的下一代标准,已经在 2015 年 6 月正式发布了.它的目标,是使得 JavaScript ...
- 【做题】CF239E. k-d-sequence——线段树
首先,容易得到判断一个子串为"good k-d sequence"的方法: 子串中没有重复元素,且所有元素模d相等. 记mx为除以d的最大值,mn为除以d的最小值,则\(mx-mn ...