Установка Node.js и NPM на Windows

В последнее время JavaScript (далее — JS) становится очень популярным языком программирования для веб-разработчиков. Front-end разработчики используют js для улучшения пользовательского интерфейса, добавления интерактивности и коммуникации с Back-end веб-сервисами используя AJAX. Web developers who work on the server-side are also flocking to JavaScript because of the efficiencies and speed offered by JavaScript’s event-driven, non-blocking nature.

In fact, concentrating on JavaScript as your language of choice offers the opportunity to master a single language while still being able to develop “full-stack” web applications. The key to this server-side JavaScript revolution is Node.js® — a version of Chrome’s V8 JavaScript runtime engine — which makes it possible to run JavaScript on the server-side.

Так же Node.js можно использовать для разработки десктопных приложений и для разворачивания инструментов, упрощающих web-разработку. Например, с помощью установленного Node.js, вы можете быстро выполнить преобразование CoffeeScript и TypeScript в JavaScript, SASS в CSS, минифицировать код JavaScript, HTML, CSS и графических файлов. Так же в состав входит полезный инструмент NPM, который позволит разработчику легко управлять модулями.

Например, для установки модуля в консоли нужно выполнить команду:

npm i %название_модуля%

Установка Node.js под Windows гораздо легче установки под другие операционные системы.

Prerequisites

Node isn’t a program that you simply launch like Word or Photoshop: you won’t find it pinned to the taskbar or in your list of Apps. To use Node you must type command-line instructions, so you need to be comfortable with (or at least know how to start) a command-line tool like the Windows Command Prompt, PowerShell, Cygwin, or the Git shell (which is installed along with Github for Windows).

Installation Overview

Installing Node and NPM is pretty straightforward using the installer package available from the Node.js® web site.

Installation Steps

  • Download the Windows installer from the Nodes.js® web site.
  • Run the installer (the .msi file you downloaded in the previous step.)
  • Follow the prompts in the installer (Accept the license agreement, click the NEXT button a bunch of times and accept the default installation settings).
  • Restart your computer. You won’t be able to run Node.js® until you restart your computer.

Test it!

Make sure you have Node and NPM installed by running simple commands to see what version of each is installed and to run a simple test program:

  • est Node. To see if Node is installed, open the Windows Command Prompt, Powershell or a similar command line tool, and type node -v. This should print a version number, so you’ll see something like this v0.10.35.
  • Test NPM. To see if NPM is installed, type npm -v in Terminal. This should print NPM’s version number so you’ll see something like this 1.4.28
  • Create a test file and run it. A simple way to test that node.js works is to create a JavaScript file: name it hello.js, and just add the code console.log('Node is installed!');. To run the code simply open your command line program, navigate to the folder where you save the file and type node hello.js. This will start Node and run the code in the hello.js file. You should see the output Node is installed!.

Как обновить Node.js и NPM

Достаточно часто выходят новые версии Node.js и NPM. Для установки обновлений необходимо скачать установщик с официального сайта Node.js и запустить его. The new version of Node and NPM will replace the older versions.

Как удалить Node.JS и NPM

Удалить Node.JS и NPM вы можете как же, как большинство других программ Windows:

  • Открыть "Панель управления"
  • Выбрать пункт "Программы и компоненты" (В зависимости от версии Windows название может отличаться)
  • Выбрать Node.js и нажать кнопку "Удалить"

После установки Node.JS у вас появляется доступ к большому количеству модулей из набора пакетного менеджера NPM, которые помогут решить справится с широким спектром задач на веб-сервере или на вашем компьютере. На официальном сайте NPM можно найти описание всех модулей, а так же рейтинг каждого из них, что поможет упростить выбор. Have fun and check out my current courses at Treehouse. And after, you’ve installed Node, check out the Node.js Basics course on Treehouse by my colleague, Andrew Chalkley.

Комментарии

Публикация комментария

Имя:

E-mail:

Комментарий:

© 2008-2020 Spider13 Software | Мы ВКонтакте | Мы в Twitter | Мы на Facebook