简体   繁体   English

将node.js应用移植并部署为Windows服务

[英]port and deploy node.js app to windows as service

I've got a node.js application that is working on on linux. 我有一个在Linux上运行的node.js应用程序。 I need to deploy this to clients on a windows machine. 我需要将此部署到Windows计算机上的客户端。 What's the best way to package it up in an installer (or similar) and install it as a windows service. 将其打包到安装程序(或类似程序)中并将其作为Windows服务安装的最佳方法是什么。 I can't assume the client machine will have node, so perhaps the installer would need to setup all npm packages (express, etc) and even install node itself. 我不能假定客户端计算机将具有节点,因此安装程序可能需要设置所有npm软件包(express等),甚至安装节点本身。 I'm open to alternative approaches that accomplish the final goal: which is is to get my node app running as a windows service on a virgin machine (no node installation, etc.) 我对实现最终目标的替代方法持开放态度:这是使我的节点应用程序在原始计算机上作为Windows服务运行(无需安装节点等)。

Thanks 谢谢

I'm using Advanced Installer to create setup packages for Windows and I think this should be easily accomplished with it. 我正在使用Advanced Installer创建Windows的安装程序包,我认为应该可以很容易地完成安装。 From your requirements I think that all you need to configure into an Advanced Installer setup project is: 根据您的要求,我认为您需要配置到Advanced Installer设置项目中的全部是:

  1. add Node.JS setup package as a prerequisite in "Prerequisites" page 在“先决条件”页面中将Node.JS安装程序包添加为先决条件
  2. add your Node.JS application files in "Files and Folders" page 在“文件和文件夹”页面中添加您的Node.JS应用程序文件
  3. add your Node.JS application in "Services" page to be installed as a service 在“服务”页面中添加您的Node.JS应用程序以将其安装为服务

Note. 注意。 The Prerequisites and Services pages require at least a Professional license, but all of these can be tested with a free trial. 先决条件和服务页面至少需要专业许可,但是所有这些均可通过免费试用进行测试。

EDIT :___ Video on how to package a Node.js app with Advanced Installer . 编辑 :___ 有关如何使用Advanced Installer打包Node.js应用程序的视频

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM