windows - node, forever, coffee - 在 linux 上运行良好但在 windows 上运行不佳

标签 windows node.js coffeescript forever

我们的客户使用 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)

最佳答案

看看你是如何调用 forevercoffeescript 命令的,我假设这些包是本地安装的(不是全局的)并且在你的 package.json

如果是这种情况,那么也许您可以尝试在 package.jsonscripts 部分创建一个命令,它将执行当前脚本的操作,如下所示:

{
  "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/

相关文章:

windows - 从 C++ 源文件创建 Windows DLL

javascript - Promise 链接,使用另一个请求的结果

mysql - 使用 Node 在准备好的语句中转义数据库名称

node.js - 使用 npm 命令启动带有参数的 NodeJS 项目

javascript - Angular Coffeescript 到 Javascript 的转换 - 下一个函数被视为前一个函数的主体

coffeescript - 如何在 Coffeescript 中正确格式化长复合 if 语句

windows - 如何在 Windows XP 中转发进程的 TCP/IP 流量?

c++ - 一个线程写入变量,另一个线程读取该变量,我如何(C++11 之前)保护该变量?

c++ - 将 GTKmm 添加到 CodeBlocks - Windows

node.js - 早午餐:无法从 "initialize"找到模块 "/"