Node js windows server 2003

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

  • Home
  • Products
  • AlwaysUp
  • Applications
  • Node.js

How to Run Any Node.js Application as a Windows Service with AlwaysUp

Start your Node.js script when your PC boots and keep it running 24/7 in the background. No need to log in!

Node.js is a platform for building scalable, server-side Javascript applications.

AlwaysUp includes advanced tools to make Node.js start at boot and run 24/7.

The Application Advisor will help you install Node.js as a Windows Service with all our recommended settings — in just a few clicks. Simply select Advisor from the Application menu and follow the straightforward prompts.

To configure your Node.js script as a Windows Service with AlwaysUp 8.0 and later:

  1. Download and install and configure Node.js, if necessary.

  2. Download and install AlwaysUp, if necessary.

  3. Start AlwaysUp.

  4. Select Application > Add to open the Add Application window:

    Add Application

  5. On the General tab:

    • In the Application field, enter the full path to the Node.js executable, node.exe.
      By default, this will be:

      C:\Program Files\nodejs\node.exe

    • In the Arguments field, enter the full path to your Node.js script, enclosing the entire thing in quotes if it has a space.
      We have specified our slightly modified version of the sample web server script mentioned on the Node.js home page,
      saved as C:\Scripts\web-server.js.

    • In the Name field, enter the name that you will call the application in AlwaysUp.
      We have specified Node.js Server but you can specify another name if you like.

    Node.js Windows Service: General Tab

  6. Click over to the Startup tab and check the Ensure that the Windows Networking components have started box.
    This informs AlwaysUp that Node.js needs TCP/IP networking support to do its work.

    Node.js Windows Service: Startup Tab

  7. Click the Save >> button. In a couple of seconds, an application called Node.js Server will show up in the AlwaysUp window.
    It is not yet running though.

    Node.js Windows Service: Created

  8. To start your application from AlwaysUp, choose Application > Start «Node.js Server»:

    Node.js Windows Service: Running

    Note that Node.js will be running in Session 0. If you are on Windows 2012/8/7/2008/Vista, you can select Tools > Switch to Session 0… to see the usual console window running in the
    isolated Session 0:

    Node.js Windows Service: Running in Session 0

  9. That’s it! Next time your computer boots, your Node.js application will start up immediately, before anyone logs on.
    We encourage you to edit your application in AlwaysUp and check out the many other settings that may be appropriate for your environment.
    For example, send email alerts if the application stops, boost its priority, etc.


Node.js not working properly as a Windows Service?

  • From AlwaysUp, select Application > Report Activity > Today… to bring up a HTML report detailing the interaction between AlwaysUp and your application.
    The AlwaysUp Event Log Messages page explains the more obscure messages.
  • Consult the AlwaysUp FAQ for answers to commonly asked questions and troubleshooting tips.
  • Contact us and we will be happy to help!

Время на прочтение1 мин

Количество просмотров1.5K

Я рад рассказать о том, что Microsoft в сотрудничестве с Joyent предоставит ресурсы для портирования Node на Windows. Как вы уже могли слышать ранее в этом году, мы начали работу над нативным портом на Windows — с целью использовать высокопроизводительный IOCP API.

Эта работа требует в значительной степени модифицировать базовую структуру и мы очень рады тому, что теперь получаем официальное руководство и инженерные ресурсы от Microsoft. От Rackspace так же выделено время Bert Belder для выполнения этой работы.

Результатом будет официальный бинарный релиз node.exe опубликованный на nodejs.org, который будет работать на Windows Azure и других версиях Windows начиная с Windows Server 2003.

Всего голосов 65: ↑54 и ↓11

+43

Комментарии57

Node.js это кроссплатформенная среда исполнения, позволяющая запускать серверные (бэкенд) приложения JavaScript вне браузера. В этой статье мы рассмотрим, как установить фреймворк Node.js и его менеджер пакетов NPM в Windows.

Для установки Node.js и NPM можно скачать с официального сайта готовый установщик в виде MSI пакета (https://nodejs.org/en/download/prebuilt-installer). На сайте доступны MSI пакеты для x86 и x64 версий Windows. Если нет специальных требования, обычно рекомендуется устанавливать LTS версию Node.js (Long Term Support) .

Скачать node.js для Windows

Запустите установку из MSI пакета с настройками по умолчанию.

Установка Node.js в Windows с помощью MSI установщика

MSI пакет содержит не только сам фреймоворк Node.js, но и также менеджер пакетов NPM, который устанадливается по-умолчанию. Установщик позволяет автоматически добавить пути к директориям node.js и npm в переменные окружения Windows.

Встроенный в node.js менеджер Node Package Manager (NPM), используется для загрузки и установки сторонних модулей из внешних репозиториев.

Для компиляции некоторых модулей, установленных через npm, могут потребоваться среды разработки python и Visual Studio. Вы можете разрешить NPM автоматически устанавливать необходимые инструменты, либо установить их в дальнейшем вручную через Chocolatey (https://github.com/nodejs/node-gyp#on-windows).

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

После окончания установки, проверьте что Node.js и npm установлены. Выполните следующие команды, чтобы вывести версии инструментов:

node -v
npm -v

Также для установки Node.js можно использовать менеджер пакетов WinGet, который установлен по-умолчанию в Windows 10 и 11.

winget install OpenJS.NodeJS.LTS

установка OpenJS.NodeJS.LTS через winget

Эта команда автоматически скачает и в тихом режиме установит последнюю LTS версию Node.js.

Перезапустите консоль cmd/powershell, чтобы обновить пути в переменных окружения. Проверьте, что node.js и NPM успешно установлены и пути к ним прописаны в переменной окружения PATH:

(Get-ChildItem env:Path).value -split ";"

пути к node.js и NPM в переменных окружения

C:\Program Files\nodejs\
C:\Users\%username%\AppData\Roaming\npm

Также можно установить Node.js в Windows с помощью пакетного менеджера Chocolatey:

Choco install -y nodejs.install

Проверить работу Node.js можно с помощью простого JavaScript скрипта. Создайте текстовый файл hello.js с кодом:

console.log("Hello, world!")

Запустите скрипт с помощью node.js:

node hello.js

Для серверных развертываний Node.js, рекомендуется использовать менеджер версий NVM (Node Version Manager) для установки Node.js и npm.

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

Для установки NVM в Windows воспользуетесь пакетом NVM for Windows ( https://github.com/coreybutler/nvm-windows). Скачайте файл nvm-setup.exe и запустите установку.

Установка менеджера версий NVM (Node Version Manager) в Windows

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

nvm install 21

Вывести список установленных версий Node:

nvm list

Чтобы переключиться между версиями:

nvm use 20.11.0

При переключении версий скрипт nvm подменяет путь до Node.js в переменной PATH.

 
 
Node.js is a server-side software system designed for writing scalable Internet applications, notably web servers.
It is build on built on Chrome’s JavaScript runtime.
Programs are written on the server side in JavaScript, using event-driven, asynchronous I/O to minimize overhead
and maximize scalability.

Node.js contains a built-in HTTP server library, making it possible to run a web server without the use of external software,
such as Apache or Lighttpd, and allowing more control of how the web server works. Node.js enables web developers to
create an entire web application in JavaScript, both server-side and client-side.

The latest Node.js version can be downloaded from:
http://nodejs.org

Even numbered versions (0.4, 0.6, 0.8) are stable, and odd numbered versions (0.3, 0.5) are unstable.
The stable releases are API-stable, which means that if you are using 0.8.1 and 0.8.2 comes out, you should be able to upgrade with no issues.

Quick guides

Installing Node.js 0.10.11 on Windows

Information
none

Operating system used
Windows Vista Home Premium SP 2

Software prerequisites
none

Procedure

  1. Download and install node-v0.10.11-x86.msi
  2. Press Next button

    Node.js installation step 1

  3. Accept the terms and press Next button

    Node.js installation step 2

  4. Choose a destination folder and press Next button

    Node.js installation step 3

  5. Customize your setup and press Next button

    Node.js installation step 4

  6. Press Install button

    Node.js installation step 5

  7. Wait until Node.js is installed

    Node.js installation step 6

  8. Press Finsh button to exit the setup wizard

    Node.js installation step 7

  9. The setup wizard has automatically updated the system environment PATH
    e.g.: PATH=%PATH%;C:\Program Files\nodejs\
  10. Create the system environment NODE_PATH:
    NODE_PATH=C:\Users\<your_account>\AppData\Roaming\npm\node_modules
    e.g.: NODE_PATH=C:\Users\Robert\AppData\Roaming\npm\node_modules

    NODE_PATH is the location where the modules are globally installed.
    For example: npm install bitcoinjs-lib -g

  11. To check if Node.js is installed correctly, type: node -v
    You should see:

    v0.10.11
  12. The setup wizard also installed npm (node package manager). To verify, type: npm -v
    You should see:

    1.2.30

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Windows xp x64 sp3 russian
  • Как удалить все сохраненные пароли на компьютере windows 10
  • Как очистить буфер обмена windows 10 горячие клавиши
  • Windows 10 не обновляется до последней версии
  • Honor 10 lite драйвер windows 10