0

我正在尝试让我的节点服务器与主管一起运行。我让它在 Windows 7 中运行,但现在它一直失败。这是输出:

"C:\Program Files\nodejs\node.exe" C:\Users\Mark\AppData\Roaming\npm\node_modules\supervisor\lib\cli-wrapper.js --no-restart-on error server.js

DEBUG: Running node-supervisor with

CreateProcessW: The system cannot find the file specified.
DEBUG:   program 'server.js'
DEBUG:   --watch '.'
DEBUG:   --ignore 'undefined'
DEBUG:   --extensions 'node|js'
DEBUG:   --exec 'node'
DEBUG: Starting child process with 'node server.js'
DEBUG: Watching directory 'D:\Websites\MyProject' for changes.
DEBUG: Program node server.js exited with code 127

这家伙建议改用nodemon,但结果或多或少是一样的:

"C:\Program Files\nodejs\node.exe" C:\Users\Mark\AppData\Roaming\npm\node_modules\nodemon\nodemon.js server.js
26 Jan 22:23:10 - [nodemon] v0.7.1
26 Jan 22:23:10 - [nodemon] watching: D:\Websites\MyProject
26 Jan 22:23:10 - CreateProcessW: The system cannot find the file specified.
[nodemon] starting `node server.js`
26 Jan 22:23:10 - [nodemon] app crashed - waiting for file changes before starting...

但是,如果我运行“vanilla”node.js,它会正常启动:

"C:\Program Files\nodejs\node.exe" server.js
Listening on http://localhost:8081

可能是什么问题?是server.js找不到文件吗?为什么会找不到呢?

4

1 回答 1

1

重新启动Windows,问题消失了。现在启动很好。可能只需要重新启动 Windows 或我的 IDE 来刷新一些文件路径:-)

于 2013-01-27T04:05:29.383 回答