как установить node js на linux kali
Как установить Node.js в Kali Linux
Получение программного обеспечения непосредственно из исходного кода является обычной процедурой на компьютерах Unix и обычно включает в себя следующие три шага: настройка make-файла, компиляция кода и, наконец, установка исполняемого файла в стандартные места. Чтобы работать с Node.js в Kali Linux, рекомендуется следовать упомянутому процессу, поскольку это проще, чем другие решения.
Хотя Python предпочтительнее при работе с Kali Linux, оба языка программирования (Python и JavaScript) имеют одинаковые конечные цели. Не существует правильного или неправильного решения о том, какая платформа вам больше всего подходит, поэтому, если вы хотите работать с JavaScript вместо Python, не расстраивайтесь из-за этого. Кроме того, Node может использоваться в широком диапазоне модулей, что означает, что вы можете использовать Python в своем приложении Node.JS и наоборот.
Давайте начнем с установки!
Важный
1. Убедитесь, что у вас есть все необходимые инструменты
Заметка
2. Создайте временную папку
-d Аргумент указывает, что mktemp должен создать каталог вместо файла. В этой команде мы создаем переменную, которая содержит сгенерированный временный путь с помощью mktemp, а затем переключаемся на этот каталог в терминале.
3. Загрузите и распакуйте Node.js
Загрузите распространяемый код Node.js, выполнив в терминале следующую команду:
После завершения загрузки извлеките содержимое файла tar с помощью следующей команды:
Это должно создать папку с префиксом node-v это зависит от загруженной версии Node.js.
4. Запустите скрипт настройки
Скрипт конфигурирования — это исполняемый скрипт, предназначенный для помощи в разработке программы, которая будет запускаться на большом количестве разных компьютеров. Он сопоставляет библиотеки на компьютере пользователя с библиотеками, которые требуются программе перед компиляцией из исходного кода. Запустите скрипт настройки с помощью следующей команды:
Для создания пакета Node.js выполните следующую команду:
Обратите внимание, что для большинства полезных действий checkinstall должен запускаться от имени пользователя root. Мы будем использовать fakeroot, потому что, как вы, возможно, знаете, по соображениям безопасности рекомендуется избегать выполнения от имени пользователя root всего, что может быть сделано обычным пользователем, даже если вы можете запускать sudo, потому что это ваша машина.
Команда должна начать компилировать Node.js, и это займет некоторое время, так что расслабьтесь, получите колу и подождите.
6. Установите Node сгенерированный пакет
В этом случае название нашего пакета node_7.7.2-1_amd64.deb Теперь нам просто нужно установить его, используя dpkg, выполнив следующую команду:
Заметка
Не забудьте заменить значение i аргумент с именем сгенерированного пакета в предыдущем шаге.
Установка последних версий 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:
Шаг 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 установлены и готовы для использования в вашей системе.
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
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
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.
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:
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:
How to install Node.js in Kali Linux
Carlos Delgado
Learn how to install Node.js easily with a couple of commands in Kali Linux
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.
Important
1. Verify that you have all the required tools
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
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:
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
Remember to replace the value of the i argument with the name of the generated package in the previous step.