在win8中运行node.js w / supervisor

时间:2013-01-27 03:27:54

标签: node.js windows-8 node-supervisor

我正在尝试让我的节点服务器运行w / supervisor。我让它在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

This guy建议尝试尝试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文件吗?为什么它不能找到它?

1 个答案:

答案 0 :(得分:1)

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