2

Our client uses a windows machine and would like to have an eye on development and from time to time contribute little pieces of code.

We set up everything on linux, and it flies beautifully :)

Now, the server script doesn't run on Windows (ran npm install and all that) The script does:

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

This is the output:

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)

I understand it's kind of trying to spawn some child process, but don't understand which one and why.

maybe related to: Why am I getting errors running the coffee command in cygwin? (not using cygwin though, but windows powershell)

4

1 回答 1

0

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

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

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

并在项目的根目录上运行它:npm run forever-coffee

它应该可以在 Linux 和 Windows 上运行。

于 2014-01-16T05:39:58.790 回答