我们的客户使用 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)
我知道这是在尝试生成一些子进程,但不明白是哪一个以及为什么。
可能与: Why am I getting errors running the coffee command in cygwin? (虽然不使用 cygwin,但使用 Windows powershell)
最佳答案
看看你是如何调用 forever
和 coffeescript
命令的,我假设这些包是本地安装的(不是全局的)并且在你的 package.json
。
如果是这种情况,那么也许您可以尝试在 package.json
的 scripts
部分创建一个命令,它将执行当前脚本的操作,如下所示:
{
"name": "my-project",
"version": 0.0.1,
"scripts": {
"forever-coffee": "forever -c coffee app.coffee"
}
}
然后在项目的根目录下运行:npm run forever-coffee
它应该适用于 Linux 和 Windows。
关于windows - node, forever, coffee - 在 linux 上运行良好但在 windows 上运行不佳,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18900349/