node.js - 在windows服务上执行 "grunt serve"

标签 node.js gruntjs

我有一台安装了nodejs的Windows服务器PC。

我需要在启动时自动执行我的 grunt 应用程序,并且我想使用 Windows 服务。

解决方法可能是通过链接在“startup”文件夹中启动“cmd”,但 Windows 服务更好......有什么办法吗?

提前谢谢

卢卡

最佳答案

你可以用winser做到这一点: https://www.npmjs.com/package/winser

示例:

如果您的 gruntfile 位于 D:\app 上,并且您希望在 D:\app (cwd) 中执行 gruntfile,并且 grunt 不在您的 PATH 中 (grunt [不是 grunt-cli] 是本地安装的)

winser -i --startcmd "node D:\app\node_modules\grunt\bin\grunt --base D:\app --gruntfile D:\app\gruntfile.js"

关于node.js - 在windows服务上执行 "grunt serve",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32890301/

相关文章:

asp.net-mvc - Bower、Grunt 和 Yeoman 如何适应 Visual Studio .NET 工作流?

javascript - Grunt : Watch multiple files, 编译仅更改 - livereload 中断?

javascript - 第一次运行 Grunt build 时出错

node.js - canvas Node 模块和 Google Cloud Functions

node.js - Mongoose:跨多个领域的独特性

javascript - 如何使用 Stripe 接受比特币和美元付款?

javascript - 让 Grunt 使用 HTML 任务创建新文件而不是重写

javascript - 在 Windows 上运行 Grunt 时出错 : Fatal error: Unable to find local grunt

java - 我的 RESTful API 与 Node/Express 的字符编码错误

javascript - 在 MongooseJs 中查找特定类型的平均值