Installing Node.js via package manager
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
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.
Setup with Ubuntu:
curl -sL https://deb.nodesource.com/setup | sudo bash -Then install with Ubuntu:
sudo apt-get install -y nodejsSetup with Debian (as root):
apt-get install curlcurl -sL https://deb.nodesource.com/setup | bash -Then install with Debian (as root):
apt-get install -y nodejsOptional: install build tools
To compile and install native addons from npm you may also need to install build tools:
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 10.04 LTS (Lucid Lynx, armhf build not available)
[*]Ubuntu 12.04 LTS (Precise Pangolin)
[*]Ubuntu 14.04 LTS (Trusty Tahr)
Ubuntu 14.10 (Utopic Unicorn) is not yet officially supported but can use the Trusty binaries, details here.
Supported Debian versions:
[*]Debian 7 / stable (wheezy)
[*]Debian testing (jessie)
[*]Debian unstable (sid)
A Node.js package is also available in official repo for Debian Sid (unstable) as "nodejs".
Supported Linux Mint versions:
[*]Linux Mint 13 "Maya" (via Ubuntu 12.04 LTS)
[*]Linux Mint 17 "Qiana" (via Ubuntu 14.04 LTS)
[*]Linux Mint Debian Edition (LMDE) stable (via Debian stable)
[*]Linux Mint Debian Edition (LMDE) testing (via Debian testing)
[*]Linux Mint Debian Edition (LMDE) unstable (via Debian unstable)
Supported elementary OS versions:
[*]elementary OS Luna (via Ubuntu 12.04 LTS)
[*]elementary OS Freya (via Ubuntu 14.04 LTS)
Enterprise Linux and FedoraIncluding 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 -sL https://rpm.nodesource.com/setup | bash -Then install, as root:
yum install -y nodejsOptional: 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 Fedora versions:
[*]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)
AlternativesOfficial Fedora Node.js and npm packages are available in Fedora 18 and later.Install with:
sudo yum install nodejs npmIn 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=epelIn 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)
GentooNode.js is available in the portage tree.
emerge nodejsopenSUSE and SLEDownload 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.jssudo zypper in nodejs nodejs-develArch LinuxNode.js is available in the Community Repository.
pacman -S nodejsFreeBSD and OpenBSDNode.js is available through the ports system.
/usr/ports/www/nodeDevelopment versions are also available using ports
cd /usr/ports/www/node-devel/ && make install cleanOr packages on FreeBSD:
pkg_add -r node-develUsing pkg-ng on FreeBSD
pkg install nodeOr the development versions:
pkg install node-develOSXSimply download the Macintosh Installer direct from the nodejs.org web site.
AlternativesUsing Homebrew:
brew install nodeUsing MacPorts:
port install nodejsWindowsSimply download the Windows Installer directly from the nodejs.org web site.
AlternativesUsing Chocolatey:
cinst nodejs# or for full install with npmcinst nodejs.installUsing Scoop:
scoop install nodejs
摘自:https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager#arch-linux
页:
[1]