我有一台安装了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/