How to install Node.js on Linux
How to install Node.js on Linux
Node.js is a server-side software platform built on Google's V8 JavaScript engine. Node.js has become a popular choice for building high-performance server-side applications all in JavaScript. What makes Node.js even more attractive for backend server development is the huge ecosystem of Node.js libraries and applications. Node.js comes with a command line utility called npm which allows you to easily install, version-control, and manage dependencies of Node.js libraries and applications from the vast npm online repository.
In this tutorial, I will describe how to install Node.js on major Linux distros including Debian, Ubuntu, Fedora and CentOS.
Node.js is available as a pre-built package on some distros (e.g., Fedora or Ubuntu), while you need to install it from its source on other distros. As Node.js is fast evolving, it is recommended to install the latest Node.js from its source, instead of installing an outdated pre-built package. The lasted Node.js comes with npm (Node.js package manager) bundled, allowing you to install external Node.js modules easily.
Install Node.js on Debian
Starting from Debian 8 (Jessie), Node.js is available in the official repositories. Thus you can install it with:
On Debian 7 (Wheezy) or earlier, you can install Node.js from its source as follows.
$ wget http://nodejs.org/dist/node-latest.tar.gz
$ tar xvfvz node-latest.tar.gz
$ cd node-v0.10.21 (replace a version with your own)
$ ./configure
$ make
$ sudo make install
Install Node.js on Ubuntu or Linux Mint
Node.js is included in Ubuntu (13.04 and higher). Thus installation is straightforward. The following will install Node.js and npm.
$ sudo ln -s /usr/bin/nodejs /usr/bin/node
While stock Ubuntu ships Node.js, you can install a more recent version from its PPA.
$ sudo add-apt-repository -y ppa:chris-lea/node.js
$ sudo apt-get update
$ sudo apt-get install npm
Install Node.js on Fedora
Node.js is included in the base repository of Fedora. Therefore you can use yum to install Node.js on Fedora.
If you want to install the latest version of Node.js, you can build it from its source as follows.
$ wget http://nodejs.org/dist/node-latest.tar.gz
$ tar xvfvz node-latest.tar.gz
$ cd node-v0.10.21 (replace a version with your own)
$ ./configure
$ make
$ sudo make install
Install Node.js on CentOS or RHEL
To install Node.js with yum package manager on CentOS, first enable EPEL repository, and then run:
If you want to build the latest Node.js on CentOS, follow the same procedure as in Fedora.
Install Node.js on Arch Linux
Node.js is available in the Arch Linux community repository. Thus installation is as simple as running:
Check the Version of Node.js
Once you have installed Node.js, you can check Node.js version as follows
On ec2 instance, you may need to do :
sudo ln -s /usr/local/bin/node /usr/bin/node
sudo ln -s /usr/local/lib/node /usr/lib/node
sudo ln -s /usr/local/bin/npm /usr/bin/npm
sudo ln -s /usr/local/bin/node-waf /usr/bin/node-waf
How to install Node.js on Linux的更多相关文章
- Node.js~在linux上的部署~pm2管理工具的使用
之前写了两篇关于在linux上部署nodejs的文章,大家如果没有基础可以先看前两篇<Node.js~在linux上的部署>,<Node.js~在linux上的部署~外网不能访问no ...
- node.js & Unbuntu Linux & nvm & npm
node.js & Unbuntu Linux & nvm & npm https://websiteforstudents.com/install-the-latest-no ...
- Node.js & Unix/Linux & NVM
Node.js & Unix/Linux & NVM nvm https://github.com/creationix/nvm https://github.com/xyz-data ...
- Linux Install Node.js
1.下载node.js安装包,请参考网址:http://nodejs.org/download/ 在这个网址里面提供了几种node.js安装的方式 https://github.com/joyent/ ...
- [译]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 ...
- Node.js~在linux上的部署~外网不能访问node.js网站的解决方法
这是上一篇node.js部署到linux上的后续文章,当我们安装完node.js之后,建立了sailsjs的网站,然后在外面电脑上无法访问这个网站,这个问题我们如何去解决? 解决思路: 查看linux ...
- Node.js~在linux上的部署
我们以centOS为例来说说如何部署node.js环境 一 打开centos,然后开始下载node.js包 curl --silent --location https://rpm.nodesourc ...
- node.js在linux下的安装
简单说就是解压后,在bin文件夹中已经存在node以及npm,如果你进入到对应文件的中执行命令行一点问题都没有,不过不是全局的,所以将这个设置为全局就好了. ? 1 2 3 cd node-v0.10 ...
- node.js在Linux下执行shell命令、.sh脚本
首先,引入子进程模块 var process = require('child_process'); 执行shell命令 调用该模块暴露出来的方法exec process.exec('shutdown ...
随机推荐
- Metasploit Framework命令汇总
一.msfconsole ? 帮助菜单back 从当前环境返回banner 显示一个MSF bannercd 切换目录color 颜色转换connect 连接一个主机exit 退出MSFhelp 帮助 ...
- FormCreate & FormActivate & FormShow执行顺序演示
procedure TForm1.FormCreate(Sender: TObject);begin form1.Caption:=form1.Caption +'+Create'; end; pr ...
- C编译错误解决方法
1.expected identifier before numeric constant 一般情况下是枚举类型中的某个变量已经被#define定义过一次了,在项目空间中搜索你枚举类型中的所有变量类型 ...
- 纯CSS3实现3D动画导航,html5 webRTC技术实现免费网页电话拨打
花了一周的时间完成了 说吧 (免费网页电话) 的前端开发工作,先将技术点总结如下: 免费电话采用最新的html5 webRTC 技术 实现互联网和电信MIS网互通实现网页电话,目前只有 google ...
- RMQ(st)
int dp[1111][12]; int a[1111]; int n; void RMQ_init() { for(int i=1;i<=n;i++) { d ...
- 17+个ASP.NET MVC扩展点,含源码{转}
1.自定义一个HttpModule,并将其中的方法添加到HttpApplication相应的事件中!即:创建一个实现了IHttpmodule接口的类,并将配置WebConfig.在自定义的HttpMo ...
- iOS终端查看.a文件是否能在模拟器上运行
复制文件路径进去: 红色框框里面没有x86所以模拟器运行会报错
- POJ 1144 Network(Tarjan)
题目链接 题意 : 找出割点个数. 思路 : Tarjan缩点,u是割点的充要条件是:u要么是具有两个以上子女的深度优先生成树的根,要么不是根,而有一个子女v满足low[v]>=dfn[u]. ...
- 由枚举模块到ring0内存结构 (分析NtQueryVirtualMemory)
是由获得进程模块而引发的一系列的问题,首先,在ring3层下枚举进程模块有ToolHelp,Psapi,还可以通过在ntdll中获得ZwQuerySystemInformation的函数地址来枚举,其 ...
- 《从零开始学习jQuery》及《jQuery风暴》学习笔记
第一章 jQuery入门 1.用$()函数其实是一个事件,使用这个函数调用的方法,会在DOM加载完毕.资源文件加载完之前触发. 第二章 必须知道的JavaScript知识 1.JavaScript实际 ...