节点,永远,咖啡 – 在Linux上运行很好,但不是在Windows上

我们的客户使用一台Windows机器,并希望有一个发展的眼睛,并不时贡献一小段代码。

我们在linux上设置了一切,它飞得很漂亮:)

现在,服务器脚本不能在Windows上运行(运行npm install和所有这些)脚本会:

SET NODE_ENV=development node_modules\.bin\forever.cmd -c node_modules\.bin\coffee app.coffee 

这是输出:

 C:\Users\user\Documents\GitHub\myapp\server>node_modules\.bin\forever.cmd -c node_modules\.bin\coffee app.coffee warn: --minUptime not set. Defaulting to: 1000ms warn: --spinSleepTime not set. Your script will exit if it does not stay up f or at least 1000ms events.js:72 throw er; // Unhandled 'error' event ^ Error: spawn ENOENT at errnoException (child_process.js:980:11) at Process.ChildProcess._handle.onexit (child_process.js:771:34) 

我知道这是一种试图产生一些孩子的过程,但不明白哪一个,为什么。

可能涉及到: 为什么我在cygwin中运行coffee命令时出错? (虽然不使用cygwin,但Windows PowerShell的)

看看你是如何调用forevercoffeescript命令,我将假定这些软件包将被安装在本地(不是全局的),并在package.json中指定。

如果是这种情况,那么也许你可以尝试在你的package.jsonscripts部分创建一个命令来完成你当前的脚本的功能,如下所示:

 { "name": "my-project", "version": 0.0.1, "scripts": { "forever-coffee": "forever -c coffee app.coffee" } } 

在你的项目的根目录下npm run forever-coffeenpm run forever-coffee

它应该在Linux和Windows上工作。