Npm install linux ubuntu

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.

Android

Android support is still experimental in Node.js, so precompiled binaries are not yet provided by Node.js developers.

However, there are some third-party solutions. For example, Termux community provides terminal emulator and Linux environment for Android, as well as own package manager and extensive collection of many precompiled applications. This command in Termux app will install the last available Node.js version:

Currently, Termux Node.js binaries are linked against system-icu (depending on libicu package).

Arch Linux

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

CentOS, Fedora and Red Hat Enterprise Linux

Node.js is available as a module called nodejs in CentOS/RHEL 8 and Fedora.

where corresponds to the major version of Node.js. To see a list of available streams:

For example, to install Node.js 12:

For CentOS/RHEL 7 Node.js is available via Software Collections.

Alternatives

These resources provide packages compatible with CentOS, Fedora, and RHEL.

Debian and Ubuntu based Linux distributions

Alternatives

Packages compatible with Debian and Ubuntu based Linux distributions are available via Node.js snaps.

Fast and simple Node.js version manager built in Rust used to manage multiple released Node.js versions. It allows you to perform operations like install, uninstall, switch Node versions automatically based on the current directory, etc. To install fnm, use this install script.

fnm has cross-platform support (macOS, Windows, Linux) & all popular shells (Bash, Zsh, Fish, PowerShell, Windows Command Line Prompt). fnm is built with speed in mind and compatibility support for .node-version and .nvmrc files.

FreeBSD

The most recent release of Node.js is available via the www/node port.

Install a binary package via pkg:

Or compile it on your own using ports:

Gentoo

Node.js is available in the portage tree.

IBM i

LTS versions of Node.js are available from IBM, and are available via the ‘yum’ package manager. The package name is nodejs followed by the major version number (for instance, nodejs12 , nodejs14 etc)

To install Node.js 14.x from the command line, run the following as a user with *ALLOBJ special authority:

Node.js can also be installed with the IBM i Access Client Solutions product. See this support document for more details

macOS

Download the macOS Installer directly from the nodejs.org web site.

If you want to download the package with bash:

Alternatives

Using Homebrew:

Using MacPorts:

Using pkgsrc:

Install the binary package:

Or build manually from pkgsrc:

n is a simple to use Node.js version manager for Mac and Linux. Specify the target version to install using a rich syntax, or select from a menu of previously downloaded versions. The versions are installed system-wide or user-wide, and for more targeted use you can run a version directly from the cached downloads.

Читайте также:  Screen mirroring from windows to android

See the homepage for install methods (boostrap, npm, Homebrew, third-party), and all the usage details.

If you already have npm then installing n and then the newest LTS node version is as simple as:

NetBSD

Node.js is available in the pkgsrc tree:

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

Nodenv

nodenv is a lightweight node version manager, similar to nvm . It’s simple and predictable. A rich plugin ecosystem lets you tailor it to suit your needs. Use nodenv to pick a Node version for your application and guarantee that your development environment matches production.

Nodenv installation instructions are maintained on its Github page. Please visit that page to ensure you’re following the latest version of the installation steps.

Node Version Manager is a bash script used to manage multiple released Node.js versions. It allows you to perform operations like install, uninstall, switch version, etc. To install nvm, use this install script.

On Unix / OS X systems Node.js built from source can be installed using nvm by installing into the location that nvm expects:

After this you can use nvm to switch between released versions and versions built from source. For example, if the version of Node.js is v8.0.0-pre:

Once the official release is out you will want to uninstall the version built from source:

Windows

The nvs version manager is cross-platform and can be used on Windows, macOS, and Unix-like systems

To install nvs on Windows go to the release page here and download the MSI installer file of the latest release.

You can also use chocolatey to install it:

macOS,UnixLike

You can find the documentation regarding the installation steps of nvs in macOS/Unix-like systems here

Usage

After this you can use nvs to switch between different versions of node.

To add the latest version of node:

Or to add the latest LTS version of node:

Then run the nvs use command to add a version of node to your PATH for the current shell:

To add it to PATH permanently, use nvs link :

OpenBSD

Node.js is available through the ports system.

Using pkg_add on OpenBSD:

openSUSE and SLE

Node.js is available in the main repositories under the following packages:

  • openSUSE Leap 15.2: nodejs10 , nodejs12 , nodejs14
  • openSUSE Tumbleweed: nodejs16
  • SUSE Linux Enterprise Server (SLES) 12: nodejs10 , nodejs12 , and nodejs14 (The «Web and Scripting Module» must be enabled.)
  • SUSE Linux Enterprise Server (SLES) 15 SP2: nodejs10 , nodejs12 , and nodejs14 (The «Web and Scripting Module» must be enabled.)

For example, to install Node.js 14.x on openSUSE Leap 15.2, run the following as root:

Different major versions of Node can be installed and used concurrently.

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:

Or build manually from pkgsrc:

Node.js snaps are available as node on the Snap store.

Solus

Solus provides Node.js in its main repository.

Void Linux

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

Windows

Download the Windows Installer directly from the nodejs.org web site.

Alternatives

Using Chocolatey:

Using Scoop:

IBM® SDK for Node.js — z/OS® is available in two installation formats, SMP/E and PAX. Select the installation format that applies to you:

В© OpenJS Foundation. All Rights Reserved. Portions of this site originally В© Joyent.

Источник

Установка Node.js через пакетный менеджер

Заметка: Пакеты, описанные на этой странице, разрабатываются и поддерживаются соответствующими упаковщиками, а не командой Node.js. Пожалуйста, сообщайте о любых проблемах, с которыми вы сталкиваетесь с конкретным пакетом. Если выяснится, что ваша проблема ― ошибка в самом Node.js, проблема будет передана выше.

Читайте также:  Как узнать пароль root windows

Android

Поддержка Android все еще является экспериментальной в Node.js, поэтому предварительно скомпилированные двоичные файлы еще не предоставлены в открытом доступе.

Однако есть и сторонние решения. Например, сообщество Termux предоставляет эмулятор терминала и среду Linux для Android, а также собственный менеджер пакетов и обширную коллекцию многих предварительно скомпилированных приложений. Эта команда в приложении Termux установит последнюю доступную версию Node.js:

В настоящее время двоичные файлы Termux Node.js связаны с system-icu (в зависимости от пакета libicu ).

Arch Linux

Пакеты Node.js и npm доступны в репозитории сообщества.

Дистрибутивы Linux на основе Debian и Ubuntu, пакеты Enterprise Linux/Fedora и Snap

FreeBSD

Самый последний выпуск Node.js доступен через порт www/node.

Установите бинарный пакет через pkg:

Или скомпилируйте свой используя порты:

Gentoo

Node.js доступен в дереве портежей.

NetBSD

Node.js доступен в дереве pkgsrc:

Или установите бинарный пакет (если он доступен для вашей платформы) с помощью pkgin:

Node Version Manager ― это bash-скрипт, используемый для управления несколькими выпущенными версиями Node.js. Он позволяет выполнять такие операции, как установка, удаление, переключение версий и т.д.. Чтобы установить nvm, используйте этот скрипт установки.

В системах Unix/OS X Node.js, созданный из исходного кода, можно установить с помощью nvm путем установки в папку по умолчанию nvm:

После этого вы можете использовать nvm для переключения между выпущенными версиями и версиями построенных из исходного кода. Например, если версия Node.js v8.0.0-pre:

После выхода официального релиза вы захотите удалить встроенную версию:

Windows

The nvs version manager is cross-platform and can be used on Windows, macOS, and Unix-like systems

To install nvs on Windows go to the release page here and download the MSI installer file of the latest release.

You can also use chocolatey to install it:

macOS,UnixLike

You can find the documentation regarding the installation steps of nvs in macOS/Unix-like systems here

Usage

After this you can use nvs to switch between different versions of node.

To add the latest version of node:

Or to add the latest LTS version of node:

Then run the nvs use command to add a version of node to your PATH for the current shell:

To add it to PATH permanently, use nvs link :

OpenBSD

Node.js доступен через систему портов.

Использование pkg_add в OpenBSD:

openSUSE и SLE

Node.js доступен в основных репозиториях в следующих пакетах:

  • openSUSE Leap 42.2: nodejs4
  • openSUSE Leap 42.3: nodejs4 , nodejs6
  • openSUSE Tumbleweed: nodejs4 , nodejs6 , nodejs8
  • SUSE Linux Enterprise Server (SLES) 12: nodejs4 , nodejs6 («Модуль Web и Scripting» должен быть добавлен перед установкой.)

Например, чтобы установить Node.js 4.x в openSUSE Leap 42.2, запустите следующее от имени пользователя root:

macOS

Просто загрузите установщик macOS прямо с веб-сайта nodejs.org.

Если вы хотите скачать пакет с bash:

Альтернативы

Использование Homebrew:

Использование MacPorts:

Использование pkgsrc:

Установка бинарных файлов:

Или сборка с помощью pkgsrc:

SmartOS и illumos

Образы SmartOS поставляются с предустановленным pkgsrc. В других дистрибутивах Illumos сначала установите pkgsrc, затем вы сможете установить бинарный пакет как обычно:

Или собрать с помощью pkgsrc:

Solus

Solus предоставляет Node.js в своем основном репозитории.

Void Linux

Void Linux поставляет стабильный файл Node.js в основном репозитории.

Windows

Просто загрузите Установщик Windows прямо с веб-сайта nodejs.org.

Альтернативы

Использование Chocolatey:

Использование Scoop:

В© OpenJS Foundation. All Rights Reserved. Portions of this site originally В© Joyent.

Источник

Как Установить Node.js и NPM в Ubuntu 18.04

В этой статье мы покажем вам, как установить Node.js и NPM в Ubuntu 18.04. Этот метод работает для локальных машин Linux и виртуальных частных серверов. Мы рассмотрим два способа. Вы также узнаете, как удалить эту функцию, если решите, что она не для вас.

Читайте также:  Windows update install package

Прокачайте ваш проект, воспользовавшись скидками на VPS-хостинг в Hostinger! Большой выбор планов, как для учебных, так и для крупных коммерческих проектов.

Что такое Node.js

На сегодня Node.js является одной из самых популярных веб-технологий. Этой платформой пользуются многие разработчики, поскольку с её помощью можно создавать действительно функциональные веб-приложения. Её также используют некоторые крупные компании. Всё это свидетельствует о потенциале технологии.

Node.js — среда исполнения на стороне сервера, позволяющая запускать JavaScript без клиента. Это кроссплатформенная программа с открытым исходным кодом, что делает её идеальным решением для различных проектов — как для образовательных, так и рабочих.

На момент написания статьи последней стабильной версией Node.js была 11.10.0, но для большинства пользователей рекомендовалась версия с долгосрочной поддержкой 10.15.1. Вы можете использовать любую удобную для вас версию, в том числе и последнюю на момент прочтения.

Есть несколько способов установки Node.js и NPM в Ubuntu, здесь мы покажем два самых простых и эффективных.

Важно: Для того, чтобы начать, у вас должен быть доступ к серверу, а также возможность выполнять команды с помощью sudo. Cмотрите руководство о том, как получить доступ к вашему VPS через ssh. Также обратите внимание, что вам не нужно использовать оба метода. Выберите тот, который вам больше всего подходит.

Установка Node.js и NPM из официального репозитория Ubuntu

Самый простой и быстрый способ установки Node.js и NPM на сервер с Ubuntu 18.04 — через официальный репозиторий.

Сначала подключитесь к вашему серверу, используя ssh.

Если вы работаете в системе с Ubuntu, просто откройте эмулятор терминала из главного меню.

После подключения обновите кэш APT. Для этого выполните следующую команду:

Таким образом, мы убеждаемся, что репозитории синхронизированы и система может безопасно загружать то, что в них хранится.

После этого вы можете установить Node.js:

Процесс установки начнется после ввода пароля.

Вы также можете установить NPM — менеджер пакетов Node.js. Установка NPM вызывается командой

Наконец, проверьте установленную версию с помощью команды

Это самый простой способ установки Node.js на компьютер или VPS на Linux.

Чтобы удалить Node.js, выполните следующий шаг:

Установка определенной версии Node.js, используя NVM

Установка Node.js на сервер с Ubuntu 18.04 может быть реализована и другим способом. Используя NVM (Node Version Manager), мы можем выбрать конкретную версию для установки. Это замечательно, если вы хотите использовать версию LTS или последнюю доступную.

Сначала загрузите NVM с помощью wget. Если вы не уверены есть ли у вас wget, запустите эту команду:

Следующий шаг — разрешить использование NVM из вашего профиля пользователя bash, выполнив этот шаг:

Теперь вы можете использовать NVM, чтобы показать все версии Node.js, доступные для установки в Ubuntu.

Вы можете выбрать любую версию. Для этого выполните эту команду:

Вы можете убедиться в успешности установки, проверив версию Node.js. Для этого выполните:

Как видите, установка Node.js в Ubuntu прошла успешно, всё готово к использованию.

Если вы хотите удалить Node.js и установить снова с помощью этого метода, сначала деактивируйте его.

Затем удалите Node.js.

Выводы

Node.js — очень полезная технология для разработки веб-приложений. Установка Node.js на сервер с Ubuntu 18.04 — несложный процесс. И мы показали вам два способа, как это сделать.

Ольга уже около пяти лет работает менеджером в сфере IT. Написание технических заданий и инструкций — одна из её главных обязанностей. Её хобби — узнавать что-то новое и создавать интересные и полезные статьи о современных технологиях, веб-разработке, языках программирования и многом другом.

Источник

Оцените статью