`
天梯梦
  • 浏览: 13629954 次
  • 性别: Icon_minigender_2
  • 来自: 洛杉矶
社区版块
存档分类
最新评论

通过包管理器安装 Node.js

 
阅读更多

Note: The packages on this page are maintained and supported by their respective packagers, not the Node.js core team. Please report any issues you encounter to the package maintainer. If it turns out your issue is a bug in Node.js itself, the maintainer will report the issue upstream.


  • Debian and Ubuntu based Linux distributions
  • Enterprise Linux and Fedora
  • Gentoo
  • openSUSE and SLE
  • Arch Linux
  • Void Linux
  • FreeBSD and OpenBSD
  • NetBSD
  • OSX
  • SmartOS and illumos
  • Windows

 

Debian and Ubuntu based Linux distributions

Also including: Linux Mint, Linux Mint Debian Edition (LMDE), elementaryOS and others.

Node.js is available from the NodeSource Debian and Ubuntu binary distributions repository (formerly Chris Lea's Launchpad PPA). Support for this repository, along with its scripts, can be found on GitHub at nodesource/distributions.

NOTE: If you are using Ubuntu Precise or Debian Wheezy, you might want to read about running Node.js >= 4.x on older distros.

curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
sudo apt-get install -y nodejs

 

Optional: install build tools

To compile and install native addons from npm you may also need to install build tools:

sudo apt-get install  -y build-essential

 

(Note: The optional "nodejs-legacy" package from Debian helps prevent a conflict with the Amateur Packet Radio "Node" Program)

Available architectures:

  • i386 (32-bit)
  • amd64 (64-bit)
  • armhf (ARM 32-bit hard-float, ARMv7 and up: arm-linux-gnueabihf)

Supported Ubuntu versions:

  • Ubuntu 12.04 LTS (Precise Pangolin)
  • Ubuntu 14.04 LTS (Trusty Tahr)
  • Ubuntu 15.04 (Vivid Vervet)

Supported Debian versions:

  • Debian 7 (wheezy)
  • Debian 8 / stable (jessie)
  • Debian testing (stretch, aliased to jessie)
  • Debian unstable (sid)

A Node.js package is also available in the official repo for Debian Sid (unstable), Jessie (testing) and Wheezy (wheezy-backports) as "nodejs". It only installs a nodejs binary, so you might want to ln -s /usr/bin/nodejs /usr/bin/node for many things to work.

Supported Linux Mint versions:

  • Linux Mint 13 "Maya" (via Ubuntu 12.04 LTS)
  • Linux Mint 17 "Qiana" (via Ubuntu 14.04 LTS)
  • Linux Mint 17.1 "Rebecca" (via Ubuntu 14.04 LTS)
  • Linux Mint 17.2 "Rafaela" (via Ubuntu 14.04 LTS)
  • Linux Mint Debian Edition (LMDE) 2 "Betsy" (via Debian 8)

Supported elementary OS versions:

  • elementary OS Luna (via Ubuntu 12.04 LTS)
  • elementary OS Freya (via Ubuntu 14.04 LTS)

Supported Trisquel versions:

  • Trisquel 6 "Toutatis" (via Ubuntu 12.04 LTS)
  • Trisquel 7 "Belenos" (via Ubuntu 14.04 LTS)

Supported BOSS versions:

  • BOSS 5.0 "Anokha" (via Debian 7)

 

Enterprise Linux and Fedora

Including Red Hat® Enterprise Linux® / RHEL, CentOS and Fedora.

Node.js is available from the NodeSource Enterprise Linux and Fedora binary distributions repository. Support for this repository, along with its scripts, can be found on GitHub at nodesource/distributions.

Note that the Node.js packages for EL 5 (RHEL5 and CentOS 5) depend on the EPEL repository being available. The setup script will check and provide instructions if it is not installed.

Run as root on RHEL, CentOS or Fedora:

curl --silent --location https://rpm.nodesource.com/setup | bash  -

 

Then install, as root:

curl --silent --location https://rpm.nodesource.com/setup | bash -

 

Optional: install build tools

To compile and install native addons from npm you may also need to install build tools:

yum install gcc-c++ make
# or: yum groupinstall 'Development Tools'

 

Available architectures:

  • i386 (32-bit, not available for EL7)
  • x86_64 (64-bit)

Supported Red Hat® Enterprise Linux® versions:

  • RHEL 5 (32-bit and 64-bit)
  • RHEL 6 (32-bit and 64-bit)
  • RHEL 7 (64-bit)

Supported CentOS versions:

  • CentOS 5 (32-bit and 64-bit)
  • CentOS 6 (32-bit and 64-bit)
  • CentOS 7 (64-bit)

Supported CloudLinux versions:

  • CloudLinux 6 (32-bit and 64-bit)

Supported Fedora versions:

  • Fedora 21 (Twenty One) (32-bit and 64-bit)
  • Fedora 20 (Heisenbug) (32-bit and 64-bit)
  • Fedora 19 (Schrödinger's Cat) (32-bit and 64-bit)

Other distributions known to be supported:

  • Oracle Linux (mirrors RHEL very closely)
  • Amazon Linux (tested on 2014.03)

 

Alternatives

Official Fedora Node.js and npm packages are available in Fedora 18 and later. Install with:

sudo yum install nodejs npm

 

In a hurry for the latest updates? Grab them from updates-testing.

Enterprise Linux (RHEL and CentOS) users may use the Node.js and npm packages from the EPEL repository.

Install the appropriate epel-release RPM for your version (found on the EPEL repository homepage), then run:

sudo yum install nodejs npm --enablerepo=epel

 

In a hurry for the latest updates? Grab them from epel-testing.

Available architectures:

  • i686 (32-bit, not available for EL7)
  • x86_64 (64-bit)
  • armv6hl (Raspberry Pi, Pidora only)
  • armv7hl (32-bit ARM hard-float, ARMv7 and up, Fedora only)

Supported Red Hat® Enterprise Linux® versions:

  • RHEL 6 (i686/x86_64)
  • RHEL 7 (x86_64)

Additionally, versions of CentOS and Scientific Linux corresponding to the above RHEL versions are also officially supported by all EPEL packages, including nodejs. Amazon Linux is not officially supported by EPEL due to significant incompatibilities previously reported to the epel-devel mailing list, however you might find that nodejs at least still works.

Supported Fedora versions:

  • Fedora Rawhide (i686/x86_64/armv7hl)
  • Fedora 21 (i686/x86_64/armv7hl)
  • Fedora 20 (Heisenbug) (i686/x86_64/armv6hl/armv7hl)
  • Fedora 19 (Schrödinger's Cat) (i686/x86_64/armv7hl)

 

Gentoo

Node.js is available in the portage tree.

emerge nodejs

 

openSUSE and SLE

Download Node.js via openSUSE one-click.

Available RPM packages for: openSUSE 11.4, 12.1, 12.2, 12.3, 13.1, Factory and Tumbleweed; SLE 11 (with SP1/SP2/SP3 variations).

Example install on openSUSE 13.1:

sudo zypper ar \
  http://download.opensuse.org/repositories/devel:/languages:/nodejs/openSUSE_13.1/ \
  Node.js
sudo zypper in nodejs nodejs-devel

 

Arch Linux

Node.js and npm packages are available in the Community Repository.

pacman -S nodejs npm

 

Void Linux

Void Linux ships node.js stable in the main repository.

xbps-install -Sy node.js

 

FreeBSD and OpenBSD

Node.js is available through the ports system.

/usr/ports/www/node

 

Development versions are also available using ports

cd /usr/ports/www/node-devel/ && make install clean

 

Or packages on FreeBSD:

pkg_add -r node-devel

 

Using pkg-ng on FreeBSD

pkg install node

 

Or the development versions:

pkg install node-devel

 

NetBSD

Node.js is available in the pkgsrc tree:

cd /usr/pkgsrc/lang/nodejs && make install

 

Or install a binary package (if available for your platform) using pkgin:

pkgin -y install nodejs

 

OSX

Simply download the Macintosh Installer direct from the nodejs.org web site.

If you want to download the package with bash:

curl "https://nodejs.org/dist/latest/node-${VERSION:-$(wget -qO- https://nodejs.org/dist/latest/ | sed -nE 's|.*>node-(.*)\.pkg</a>.*|\1|p')}.pkg" > "$HOME/Downloads/node-latest.pkg" && sudo installer -store -pkg "$HOME/Downloads/node-latest.pkg" -target "/"

 

Alternatives

Using Homebrew:

brew install node

 

Using MacPorts:

port install nodejs

 

Using pkgsrc:

Install the binary package:

pkgin -y install nodejs

 

Or build manually from pkgsrc:

cd pkgsrc/lang/nodejs && bmake install

 

SmartOS and illumos

SmartOS images come with pkgsrc pre-installed. On other illumos distributions, first install pkgsrc, then you may install the binary package as normal:

pkgin -y install nodejs

 

Or build manually from pkgsrc:

cd pkgsrc/lang/nodejs && bmake install

 

Windows

Simply download the Windows Installer directly from the nodejs.org web site.

 

Alternatives

Using Chocolatey:

cinst nodejs
# or for full install with npm
cinst nodejs.install

 

Using Scoop:

scoop install nodejs

 

 

原文:http://nodejs.cn/download/package-manager/

手册:http://nodeapi.ucdok.com/#/api/

转自:通过包管理器安装 Node.js

 

 

 

 

 

 

分享到:
评论

相关推荐

    Node.js 开发指南.pdf

    2.4 安装Node包管理器 18 2.5 安装多版本管理器 19 2.6 参考资料 21 第3章 Node.js快速入门 23 3.1 开始用 Node.js编程 24 3.1.1 Hello World 24 3.1.2 Node.js命令行工具 25 3.1.3 建立HTTP服务器...

    Node.js安装及环境配置.pdf

    Node.js 的包管理器npm,是全球最 大的开源库生态系统。 2. 下载Node.js 打开官网下载链接:https://nodejs.org/en/download/ 如下图: 四、选择安装目录进行安装 1. 下载完成后,双击“node-v12.16.2-x64.msi”,...

    nodejs安装及环境配置.docx

    nodejs安装及环境配置 要安装和配置Node.js环境,你可以按照以下步骤进行: ### 1. 下载Node.js安装包: ...- **Linux**:你可以通过包管理器安装Node.js,例如在Ubuntu上使用以下命令: ```bash sudo apt update

    在linux中使用包管理器安装node.js

    网上文章中,在linux下安装node.js都是使用源码编译,其实node的github上已经提供了各个系统下使用各自的包管理器(package manager)安装node.js的方法。 1. 在Ubuntu中,使用如下命令: 代码如下: curl -sL ...

    Node.js v14.8.0下载

    Node.js是基于Chrome V8引擎的一键JavaScript运行时,采用单线程、异步IO和时间驱动设计来实现高并发,可以让JavaScript脱离浏览器运行在服务器上,Node.js是目前最大的开源包管理系统,推荐大家开发使用!

    nvm 是 Node.js 的版本管理工具,可以让你在同一台机器上同时安装多个版本的 Node.js,并且非常容易地在不同的项目

    使用 nvm 可以方便地安装、卸载、切换和管理 Node.js 版本,并且自带 npm 包管理器。 有了 nvm,你可以针对每一个项目选择使用合适的 Node.js 版本,避免由于版本不兼容导致的兼容性问题,也可以方便地在项目之间...

    Node.js+开发指南

    2.4 安装Node包管理器 18 2.5 安装多版本管理器 19 2.6 参考资料 21 第3章 Node.js快速入门 23 3.1 开始用 Node.js编程 24 3.1.1 Hello World 24 3.1.2 Node.js命令行工具 25 3.1.3 建立HTTP...

    win7 安装最后一个支持的nodejs-13.14.0.zip

    Node.js 的生态系统是目前最大的开源包管理系统。 Node.js 是一套用来编写高性能网络服务器的 JavaScript 工具包,一系列的变化由此开始。比较独特的是,Node.js 会假设你是在 POSIX 环境下运行它 Linux 或 Mac OS ...

    node.js安装包v8版本

    Node.js 是一个基于 Chrome V8 引擎的 JavaScript 运行环境。Node.js 使用了一个事件驱动、非阻塞式 I/O 的模型,使其轻量又高效。Node.js 的包管理器 npm

    要在计算机上安装 Node.docx

    NPM 生态系统:Node.js 的包管理器 NPM(Node Package Manager)是世界上最大的开源库生态系统之一,其中包含了数以万计的开源软件包,开发者可以方便地获取和共享代码。 灵活性与可扩展性:Node.js 支持模块化开发...

    NODE.JS最新版本下载

    简单的说 Node.js 就是运行在服务端的 JavaScript。Node.js 是一个基于 Chrome V8 引擎的 JavaScript 运行环境。Node.js 使用了一个事件驱动、非阻塞式 I/O 的...Node.js 的包管理器 npm,是全球最大的开源库生态系统。

    Node.js MongoDB AngularJSWeb开发中文版.part1

    3.3.3 使用Node包管理器 38 3.3.4 搜索Node封装模块 39 3.3.5 安装Node封装模块 40 3.3.6 使用package.json 41 3.4 创建Node.js应用程序 43 3.4.1 创建Node.js模块封装 43 3.4.2 将一个Node.js封装模块发布到NPM...

    node.js安装

    Node.js 是一个基于 Chrome V8 引擎的 JavaScript 运行环境。 Node.js 使用了一个事件驱动、非阻塞式 I/O 的模型,使其轻量又高效。 Node.js 的包管理器 npm,是全球最大的开源库生态系统

    node-v14.5.0.tar.gz

    此外,Node.js使用了模块化的架构,通过npm(Node package manager,Node包管理器),社区成员可以共享和复用代码,极大地促进了Node.js生态系统的发展和扩张。 Node.js不仅用于服务器端开发。随着技术的发展,它也...

    基于node.js小程序云开发实现的推文留言板设计与实现.zip

    npm 是 Node 包管理工具,方便大家导入各类 JavaScript 开源包(运行在 Node.js 上),Node.js 是一个 JavaScript 运行环境,包含 npm。我引入 Vent UI 组件库就是使用 npm 命令安装的。 在云函数中我们可以引入第三...

    node-v12.1.0.tar.gz

    此外,Node.js使用了模块化的架构,通过npm(Node package manager,Node包管理器),社区成员可以共享和复用代码,极大地促进了Node.js生态系统的发展和扩张。 Node.js不仅用于服务器端开发。随着技术的发展,它也...

    ​ nvm,全称 node.js version management,就是nodejs版本管理用具,nvm可以快速切换使用不用

    ​ nvm,全称 node.js version ...在安装的 nodejs 的时候,npm 也会跟着一起安装,它是包管理工具。npm 管理 nodejs 中的第三方插件  nvm 管理 nodejs 和 npm 的版本。npm 可以管理 nodejs 的第三方插件。 ​

    Windows下Node.js安装及环境配置方法

    一、安装环境 1、本机系统:Windows 10 Pro(64位) 2、Node.js:v6.9.2LTS(64位) 二、安装Node.js步骤 1、下载对应你系统的Node.js版本:https://nodejs.org/en/download/ ...Node.js 的包管理器 n

    小程序开发笔记:安装 Node.js,使用 npm 引入 Vant Weapp(Vant UI)组件

    我是使用 npm 命令来引入这个库,Node Package Manager 是 Node 包管理工具,方便大家导入各类 JavaScript 开源包(运行在 Node.js 上),Node.js 是一个 JavaScript 运行环境。 首先得先下载 Node.js ,官网链接 ...

Global site tag (gtag.js) - Google Analytics