как установить node js linux mint

Установка последних версий Node.js и NPM в Linux

В этой инструкции будет показано, как установить последнюю версию Nodejs и NPM в дистрибутивы Debian/Ubuntu/Linux Mint, RHEL/CentOS и Fedora.

Nodejs – это лёгкая и эффективная платформа JavaScript, которая построена на основе движка Chrome V8 JavaScript, а NPM – это стандартный менеджер пакетов в NodeJS. Вы можете использовать их для построения масштабируемых сетевых приложений.

Шаг 1: Добавление репозитория NodeSource

В стандартных репозиториях вашего дистрибутива могут иметься Node.js и NPM. Но обычно это достаточно старые версии. Свежие версии Node.js и NPM доступны в официальном репозитории бинарных файлов NodeSource дистрибутивов Enterprise Linux, Fedora, Debian и Ubuntu, которые поддерживаются командой Nodejs. Вам нужно добавить этот источник приложений в вашу систему, чтобы иметь возможность установить последние пакеты Nodejs и NPM.

Важно: Ниже RHEL 5 и CentOS 5, пакеты Node.js зависят от репозитория EPEL, скрипт сделает проверку и в случае, если он не установлен, будут предоставлены инструкции.

Для добавления репозитория для последних версий Node.js v6 LTS используйте следующую команду как рут:

На RHEL, CentOS и Fedora:

На Debian:

На Ubuntu и Linux Mint:

как установить node js linux mint. Смотреть фото как установить node js linux mint. Смотреть картинку как установить node js linux mint. Картинка про как установить node js linux mint. Фото как установить node js linux mint

Шаг 2: Установка последних Nodejs и NPM

Теперь вы можете установить на вашу систему Nodejs и NPM используя следующую команду:

На RHEL, CentOS и Fedora

На Debian, Ubuntu и Linux Mint

Опционально: на вашей систему нужны инструменты разработчика, такие как gcc-c++ и make чтобы собирать нативные дополнения из npm.

Для установки nodejs на Arch Linux выполните команду:

Шаг 3: Тестирование последних Nodejs и NPM

В качестве простейшего теста вы можете проверить версии nodejs и NPM следующими командами:

На RHEL, CentOS и Fedora

На Debian, Ubuntu и Linux Mint

Для выполнения комплексного теста имеется специальный скрипт, вы можете запустить его следующим образом:

Вот и всё, теперь Nodejs и NPM установлены и готовы для использования в вашей системе.

Источник

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

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

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 доступен в основных репозиториях в следующих пакетах:

Например, чтобы установить 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.

Источник

How To Install Node.js on Linux Mint

как установить node js linux mint. Смотреть фото как установить node js linux mint. Смотреть картинку как установить node js linux mint. Картинка про как установить node js linux mint. Фото как установить node js linux mint

Need to install a Node.js in Linux Mint? If so, I’ll show you two ways of installing Node.js on Linux Mint. The two ways are:

Solution 1: Install Node.js from repositories in Linux Mint

Step 1.1: Update packages and install Node.js

It’s a good practice before any installation from the repositories to update the packages. This can be done by:

Then you can install latest available Node.js by next command:

You will need to enter your root password.
Once the installation is complete you can check the version and verify the installation by:

Step 1.2: Install npm on Linux Mint

Many programs like JupyterLab will require npm to be installed in order to work. npm which stands for Node Package Manager can be installed on Linux Mint by:

Step 1.3: Upgrade Node.js which is installed from repositories

The module n will take care for the upgrade of Node.js when it’s installed from PPA.

Install module n by:

Then you can install the stable Node.js by:

Note 1: Depending on the OS, versions etc you may need to use sudo.

Solution 2: Install Node.js with nvm on Linux Mint

The second way which is better and my preferred one is installing nvm and using it to install node.

Step 2.1 Install nvm on Linux Mint

The nvm installation guide is available on : nvm Install & Update Script. So in order to install nvm on Linux Mint you can follow. Get the latest installation script from the page above:

Note 1: this will download and run the script. If you like you can download it, review it and then install it.

Note 2: You need to start a new terminal or run command: source

/.bashrc in order to use nvm command.

Step 2.2 List Node versions with nvm

There are many different node packages available. In order to list all of them with nvm you can use command:

Step 2.3 Install Node.js with nvm

When you find what version you like to use then you can install it by:

Step 2.4 Use multiple Node.js versions with nvm

If you need to change the default one you can do it by:

Источник

Как установить Node.js 12 в Ubuntu / Debian / Linux Mint

как установить node js linux mint. Смотреть фото как установить node js linux mint. Смотреть картинку как установить node js linux mint. Картинка про как установить node js linux mint. Фото как установить node js linux mint

Как установить Node.js 12 в Ubuntu / Debian / Linux Mint

Node.js — это мощная среда выполнения JavaScript, построенная на движке Chrome V8 для создания быстрых и масштабируемых сетевых приложений. Это серверный JavaScript с открытым исходным кодом, который работает на различных платформах — Linux, Windows, Unix и macOS. В этом руководстве мы обсудим установку Node.js 12 LTS в Ubuntu / Debian / Linux Mint.

Node.js 12 теперь является выпуском LTS, доступным для установки в операционных системах Linux, macOS и Windows. Этот выпуск получит долгосрочную поддержку до 2022-04-30. Выпуски Node.js, появляющиеся каждый апрель, преобразуются в LTS каждый октябрь. Ниже приведены шаги, необходимые для установки Node.js 12 в Ubuntu / Debian / Linux Mint.

Шаг 1: Обновление системы

Как правило, мы работаем над обновленной системой, чтобы гарантировать отсутствие проблем с зависимостями.

Шаг 2. Добавьте Node.js APT-репозиторий

Все выпуски Node.js являются производными от официального репозитория APT. Однако это необходимо добавить в вашу систему вручную.

Шаг 3: Установите Node.js 12 в Ubuntu / Debian / Linux Mint

Добавлено хранилище Node.js. Следующим шагом является установка Node.js 12 в Ubuntu / Debian / Linux Mint. Выполнение следующих команд — это все, что нужно для установки.

Вы также можете установить средства разработки, используемые для создания собственных дополнений:

Подтвердите установку Node.js 12, проверив установленную версию.

Шаг 4: Тест Node.js в Ubuntu / Debian / Linux Mint

Создайте пример веб-сервера Node.js, который отвечает « Hello, World! ».

Создайте новый файл с именем hello-world.js со следующим содержимым.

Сохраните файл и введите следующую команду в своем терминале.

Такой вывод в терминале указывает, что сервер Node.js работает:

Если вы откроете ссылку в своем веб-браузере: « Привет, мир! Строка должна отображаться.

Источник

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.

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

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.

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 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.

openSUSE and SLE

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

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:

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

Источник

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *