Установить node js kali linux

Содержание
  1. How to install Node.js in Kali Linux
  2. Important
  3. 1. Verify that you have all the required tools
  4. 2. Create a temporary folder
  5. 3. Download and extract Node.js
  6. 4. Run configure script
  7. 5. Create Node .deb package compiling the code
  8. 6. Install Node generated package
  9. Installing NodeJs and NPM – Kali/Ubuntu
  10. Recent Comments
  11. Categories
  12. What are NodeJs & NPM
  13. How to install using git
  14. Testing our installation
  15. Как установить Node.js в Kali Linux
  16. Важный
  17. 1. Убедитесь, что у вас есть все необходимые инструменты
  18. Заметка
  19. 2. Создайте временную папку
  20. 3. Загрузите и распакуйте Node.js
  21. 4. Запустите скрипт настройки
  22. 5. Создайте Node .deb пакет, компилирующий код
  23. 6. Установите Node сгенерированный пакет
  24. Заметка
  25. How to install npm and nodejs 14.x on Kali Linux
  26. Install Nodejs 14.x and NPM on Kali Linux
  27. Step 1: Add Nodejs 14.x LTS repository
  28. Step 2: Run system update
  29. Step 3: Install Node.JS 14 on Kali Linux
  30. Step 4: Check Version
  31. Step 5: NPM update command
  32. Step 6: Upgrade npm & Node on Kali Linux
  33. Как установить Node.js и npm в Debian 10 Linux
  34. Установка Node.js и npm из репозиториев Debian
  35. Установка Node.js и npm из репозитория NodeSource
  36. Установка Node.js и npm с помощью NVM
  37. Установка средств разработки
  38. Удаление Node.js
  39. Выводы

How to install Node.js in Kali Linux

Read this article in other language

Obtaining software directly from the source code is a common procedure on Unix computers, and generally involves the following three steps: configuring the makefile, compiling the code, and finally installing the executable to standard locations. In order to work with Node.js in Kali Linux, it’s recommendable to follow the mentioned process as it’s easier than other solutions.

Although Python is prefered when working with Kali Linux, both of the programming languages (Python and JavaScript) have the same end goals. There is no right or wrong decision for adopting which platform is best suited to you, therefore if you want to work with JavaScript instead of Python don’t feel bad about that. Besides, Node can be utilized in the broad range of modules, that means that you can use Python in your Node.JS application and viceversa.

Let’s get started with the installation !

Important

«Why should i create my own .deb of Node if i can download it from the website ? ñee, what a stupid post . » . As you know, Kali Linux is not a normal Linux distribution, therefore the available package publicly in the Node website may not work properly on it. You can try it it if you want, but to guarantee a correct functionality, just follow these steps and you should not have problems later.

1. Verify that you have all the required tools

To create your own .deb package of Node, you will need python and the compiler of c++ «g++». Execute the following command to install the required tools (if they’re already installed they should be only updated):

You may get a warning like «dpkg was interrupted, you must manually run ‘ sudo dpkg —configure -a ‘ to correct the problem». You just need, as mentioned, execute sudo dpkg —configure -a to solve it and then proceed with the command again.

Besides, if you are unable to install the checkinstall package (happens usually on recent installations of Kali Linux), proceed with the fix mentioned in this article in order to install the package correctly.

2. Create a temporary folder

You should create a temporary folder to generate the .deb package of Node.js. You can create it using mktemp, to make it with a single command execute the following instruction:

The -d argument indicates that mktemp should make a directory instead of a file. In this command we are creating a variable that contains the generated temporary path by mktemp and then switching to that directory in the terminal.

3. Download and extract Node.js

Download the distributable code of Node.js executing the following command in the terminal:

Once the download finishes, extract the content of the tar file with the following command:

This should create a folder with the preffix node-v that will vary according to the downloaded version of Node.js.

4. Run configure script

A configure script is an executable script designed to aid in developing a program to be run on a wide number of different computers. It matches the libraries on the user’s computer, with those required by the program before compiling it from its source code. Run the configure script with the following command:

Читайте также:  Открытые файлы windows 2003

5. Create Node .deb package compiling the code

To create our installable package of Node.js we are going to use CheckInstall for it. CheckInstall keeps track of all the files created or modified by your installation script and builds a standard binary package (.deb, .rpm, .tgz). CheckInstall is really useful if you’ve got a tarball with software that you have to compile (exactly what we’re doing in this moment).

To create the package of Node.js execute the following command:

Note that for most useful actions, checkinstall must be run as root. We’ll use fakeroot because as you may know, for security reason, it is a good idea to avoid doing as root everything that could be done as normal user, even if you can run sudo because it is your machine.

The command should start to compile Node.js and it will take a while, so relax, get a cola and wait.

6. Install Node generated package

Once the package is compiled, in the output of the previous step, you should receive a message that specifies the name of the generated .deb package:

In this case, the name of our package is node_7.7.2-1_amd64.deb , now we just need to install it using dpkg executing the following command:

Remember to replace the value of the i argument with the name of the generated package in the previous step.

Источник

Installing NodeJs and NPM – Kali/Ubuntu

Recent Comments

Categories

What are NodeJs & NPM

NodeJs to put it simply is an open-source, cross-platform runtime environment for developing server-side web application.

Npm is the a package manager for javascript using to install and run things Such as Grunt

For more information on NodeJs or NPM follow the links in the more reading section of this post.

How to install using git

I usually find the easiest way to install both NodeJs and NPM on linux systems is straight from git. It provides the latest version and allows for patches to node and npm to be updated using pull requests and more from git, either way that’s out of scope for this tutorial so keeping it simple.

Open up a terminal and type the following

# Make our directory to keep it all in

# Add the location to our path so that we can call it with bash

echo ‘export PATH=$HOME/local/bin:$PATH’ >>

Now we can start with downloading and compiling

git clone git://github.com/nodejs/node.git

cd node

./configure –-prefix=

make install

Now NPM (Node Package Manager)

git clone git://github.com/npm/npm.git

cd npm

make install

and that’s it we are done . . .

Testing our installation

Open up a command prompt and type

Both should return a version number at the time of writing this I got npm v3.5.4 and NodeJs v6.0.0-pre

Источник

Как установить Node.js в Kali Linux

Получение программного обеспечения непосредственно из исходного кода является обычной процедурой на компьютерах Unix и обычно включает в себя следующие три шага: настройка make-файла, компиляция кода и, наконец, установка исполняемого файла в стандартные места. Чтобы работать с Node.js в Kali Linux, рекомендуется следовать упомянутому процессу, поскольку это проще, чем другие решения.

Хотя Python предпочтительнее при работе с Kali Linux, оба языка программирования (Python и JavaScript) имеют одинаковые конечные цели. Не существует правильного или неправильного решения о том, какая платформа вам больше всего подходит, поэтому, если вы хотите работать с JavaScript вместо Python, не расстраивайтесь из-за этого. Кроме того, Node может использоваться в широком диапазоне модулей, что означает, что вы можете использовать Python в своем приложении Node.JS и наоборот.

Давайте начнем с установки!

Важный

«Зачем мне создавать свой собственный .deb of Node, если я могу скачать его с сайта? — вот что за глупость …». Как вы знаете, Kali Linux не является нормальным дистрибутивом Linux, поэтому доступный публично доступный пакет на веб-сайте Node может работать на нем некорректно. Вы можете попробовать его, если хотите, но для гарантии правильной работы просто следуйте этим шагам, и у вас не должно возникнуть проблем позже.

1. Убедитесь, что у вас есть все необходимые инструменты

Чтобы создать свой собственный пакет .deb для Node, вам понадобится python и компилятор c ++ «g ++». Выполните следующую команду для установки необходимых инструментов (если они уже установлены, их следует только обновить):

Заметка

Вы можете получить предупреждение типа «dpkg был прерван, вы должны запустить вручную» sudo dpkg —configure -a «исправить проблему». Вам просто нужно, как уже упоминалось, выполнить sudo dpkg —configure -a чтобы решить ее, а затем снова выполнить команду.

Читайте также:  Linux который не тормозит

2. Создайте временную папку

Вы должны создать временную папку для создания пакета .deb Node.js. Вы можете создать его с помощью mktemp, чтобы сделать его одной командой, выполнив следующую инструкцию:

-d Аргумент указывает, что mktemp должен создать каталог вместо файла. В этой команде мы создаем переменную, которая содержит сгенерированный временный путь с помощью mktemp, а затем переключаемся на этот каталог в терминале.

3. Загрузите и распакуйте Node.js

Загрузите распространяемый код Node.js, выполнив в терминале следующую команду:

После завершения загрузки извлеките содержимое файла tar с помощью следующей команды:

Это должно создать папку с префиксом node-v это зависит от загруженной версии Node.js.

4. Запустите скрипт настройки

Скрипт конфигурирования — это исполняемый скрипт, предназначенный для помощи в разработке программы, которая будет запускаться на большом количестве разных компьютеров. Он сопоставляет библиотеки на компьютере пользователя с библиотеками, которые требуются программе перед компиляцией из исходного кода. Запустите скрипт настройки с помощью следующей команды:

5. Создайте Node .deb пакет, компилирующий код

Для создания нашего устанавливаемого пакета Node.js мы будем использовать для него CheckInstall. CheckInstall отслеживает все файлы, созданные или измененные вашим установочным скриптом, и создает стандартный двоичный пакет (.deb, .rpm, .tgz). CheckInstall действительно полезен, если у вас есть архив с программным обеспечением, которое вы должны скомпилировать (именно то, что мы делаем в данный момент).

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

Обратите внимание, что для большинства полезных действий checkinstall должен запускаться от имени пользователя root. Мы будем использовать fakeroot, потому что, как вы, возможно, знаете, по соображениям безопасности рекомендуется избегать выполнения от имени пользователя root всего, что может быть сделано обычным пользователем, даже если вы можете запускать sudo, потому что это ваша машина.

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

6. Установите Node сгенерированный пакет

Как только пакет скомпилирован, в выходных данных предыдущего шага вы должны получить сообщение, в котором указано имя сгенерированного пакета .deb:

В этом случае название нашего пакета node_7.7.2-1_amd64.deb Теперь нам просто нужно установить его, используя dpkg, выполнив следующую команду:

Заметка

Не забудьте заменить значение i аргумент с именем сгенерированного пакета в предыдущем шаге.

Источник

How to install npm and nodejs 14.x on Kali Linux

Node.js is a scripting language available to install not only on Kali Linux but for Windows, FreeBSD, macOS, and other common platforms. Whereas npm is a JavaScript programming language package manager that comes along with Node.js.

With Node.js, the popular JavaScript language has also found its way into server-side programming. Before Node.js, JavaScript was mainly responsible for the frontend and interaction with the visitor. It is quite flexible which means everything from small CLI (command line) tools to complex programs and independent HTTP servers can be developed using Nodejs.

In addition, no additional server is required for a Node.js application, as the application also represents the webserver. The fact that the server and client use the same programming language ( JavaScript ) is certainly another advantage for many users, as the entry barrier is correspondingly low, especially for web developers.

It comes with a number of built-in modules that are available without any further installation. And these modules can be easily installed using NPM, with the help of such modules we Node.js can also connect to a database (e.g. MySQL or MongoDB).

Install Nodejs 14.x and NPM on Kali Linux

There are two ways to install the latest version of node.js on kali Linux one is by adding its repository and the other by downloading the latest Debian packages of Nodejs manually from the official website. Here we will discuss both. You can use the below steps for Ubuntu 20.04, Linux Mint, Elementary OS, MX Linux, Debian, and other similar Linux distros.

Step 1: Add Nodejs 14.x LTS repository

Although there is no need to install the Nodejs repository on Kali Linux, as its packages are already present in the official repo of Kali Linux. However, the version available there is Nodejs 12.x, whereas the current LTS version is 14.x. Thus, those who want the latest version should add the below repo.

Step 2: Run system update

After adding the Nodejs 14 repo on Kali Linux run the system update command to flush the system’s repository cache and let it know that we have recently added something new.

Step 3: Install Node.JS 14 on Kali Linux

Everything we need to download the latest packages of Node.JS and NPM is in place, now it’s time to run the command to install this Javascript programming language.

Читайте также:  Hp 1525n драйвер windows 10

Step 4: Check Version

Once the installation is completed check the version:

For Nodejs

For NPM

To use the NPM for some package installation you can use it in the following way:

For example, we want to install Angular using NPM, the command will be:

For locally:

Fo Globally: -g syntax refers to the global

Step 5: NPM update command

In the future if you want to update the NPM package manager, then run the following syntax:

To list all versions of NPM you can use :

To install some old or specific version of NPM use this command:

For example, we want to install npm 5.8.0 then the command will be:

Step 6: Upgrade npm & Node on Kali Linux

If you already have both NPM and Node on your Kali Linux and want to upgrade them to the possible latest version, the command for that:

Источник

Как установить Node.js и npm в Debian 10 Linux

Node.js — это кроссплатформенная среда выполнения JavaScript, построенная на JavaScript в Chrome и предназначенная для выполнения кода JavaScript на стороне сервера. С помощью Node.js вы можете создавать масштабируемые сетевые приложения.

npm — это менеджер пакетов по умолчанию для Node.js, который помогает разработчикам делиться и повторно использовать свой код.

В этом руководстве мы покажем вам несколько различных способов установки Node.js и npm на Debian 10 Buster. Выберите вариант установки, подходящий для вашей среды.

Установка Node.js и npm из репозиториев Debian

Node.js и npm можно установить из стандартных репозиториев Debian. На момент написания в репозиториях была версия v10.x, которая является последней версией LTS.

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

Когда установка будет завершена, проверьте ее, набрав:

Команда отобразит версию Node.js:

Это самый простой способ установить Node.js и npm в Debian, и его должно хватить для большинства случаев использования.

Установка Node.js и npm из репозитория NodeSource

NodeSource — это компания, специализирующаяся на предоставлении поддержки узлов корпоративного уровня. Он поддерживает репозиторий APT, содержащий несколько версий Node.js.

Используйте этот репозиторий, если вам нужно установить определенную версию Node.js. На момент написания репозиторий NodeSource предоставляет следующие версии:

  • v14.x — последняя стабильная версия.
  • v13.x
  • v12.x — последняя LTS-версия.
  • v10.x — предыдущая версия LTS.

Мы установим Node.js версии 12.x.

Начните с добавления репозитория NodeSource в вашу систему, выполнив следующую команду curl :

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

Убедитесь, что Node.js правильно установлен, набрав:

Установка Node.js и npm с помощью NVM

NVM (Node Version Manager) — это сценарий bash, который позволяет управлять несколькими версиями Node.js. С помощью NVM вы можете установить и удалить любую версию Node.js, которую хотите использовать или протестировать.

Используйте этот метод, если вы хотите установить Node.js для каждого пользователя.

Чтобы установить NVM в вашей системе, введите команду ниже. Не используйте sudo как он активирует сценарий для пользователя root.

Сценарий установки клонирует репозиторий nvm из Github в каталог

/.nvm и добавляет путь nvm к вашему профилю Bash или ZSH.

Чтобы начать использовать сценарий nvm, откройте новый сеанс оболочки или выполните команды, напечатанные на экране. Делай то, что тебе легче.

Теперь, nvm сценарий nvm установлен в вашей системе Debian, вы можете установить последнюю стабильную версию Node.js с помощью:

Установим еще две версии, последнюю версию LTS и версию 8.16.0:

После этого, чтобы перечислить все установленные версии Node.js, введите:

Запись со стрелкой справа (-> v8.16.0) — это версия, используемая в текущем сеансе оболочки, а версия по умолчанию установлена на v12.8.1 . Версия по умолчанию — это версия, которая будет использоваться при открытии новых сеансов оболочки.

Если вы хотите изменить текущую активную версию, скажем, до v10.16.2, вы должны запустить:

Чтобы изменить Node.js по умолчанию, например, на v10.16.2 используйте:

Установка средств разработки

Инструменты разработки необходимы для компиляции и установки собственных надстроек из реестра npm. Установите пакет, запустив:

Удаление Node.js

Если по каким-либо причинам вы хотите удалить пакеты Node.js и npm, используйте следующую команду:

Выводы

Мы показали вам три различных способа установки Node.js и npm в вашу систему Debian 10. Выбор метода зависит от ваших требований и предпочтений.

Теперь, когда вы установили Node.js в свою систему Debian 10, пришло время развернуть ваше приложение.

Если вы хотите использовать Yarn для управления зависимостями вашего приложения, ознакомьтесь с нашим руководством о том, как установить и использовать yarn в Debian 10 .

Если у вас есть какие-либо вопросы или отзывы, не стесняйтесь оставлять комментарии ниже.

Источник

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