Nodejs服务器未运行

时间:2017-08-14 21:25:34

标签: node.js npm yarnpkg

当我尝试通过命令提示符启动服务器时,这是我得到的错误:

npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program
Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! node v6.11.2
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! web@0.0.0 start: `babel-node tools/run start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the web@0.0.0 start script 'babel-node tools/r
un start'.
npm ERR! Make sure you have the latest version of node.js and npm
 installed.
npm ERR! If you do, this is most likely a problem with the web pa
ckage,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     babel-node tools/run start
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs web
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls web
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\Rohan-PC\Desktop\main\npm-debug.log

以上的调试日志是:

Files\nodejs\node_modules\npm\bin\node-gyp-bin;C:\Users\Rohan-PC\Desktop\main\node_modules\.bin;C:\Program Files (x86)\Google\Chrome\Application;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\nodejs\;C:\Program Files (x86)\Yarn\bin;C:\Program Files\Git\cmd;C:\Users\Rohan-PC\AppData\Local\Microsoft\WindowsApps;C:\Users\Rohan-PC\AppData\Roaming\npm;C:\Users\Rohan-PC\AppData\Local\Yarn\bin
10 verbose lifecycle web@0.0.0~start: CWD: C:\Users\Rohan-PC\Desktop\main
11 silly lifecycle web@0.0.0~start: Args: [ '/d /s /c', 'babel-node tools/run start' ]
12 silly lifecycle web@0.0.0~start: Returned: code: 1  signal: null
13 info lifecycle web@0.0.0~start: Failed to exec start script
14 verbose stack Error: web@0.0.0 start: `babel-node tools/run start`
14 verbose stack Exit status 1
14 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:255:16)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at EventEmitter.emit (events.js:191:7)
14 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:40:14)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at ChildProcess.emit (events.js:191:7)
14 verbose stack     at maybeClose (internal/child_process.js:891:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid web@0.0.0
16 verbose cwd C:\Users\Rohan-PC\Desktop\main
17 error Windows_NT 10.0.14393
18 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
19 error node v6.11.2
20 error npm  v3.10.10
21 error code ELIFECYCLE
22 error web@0.0.0 start: `babel-node tools/run start`
22 error Exit status 1
23 error Failed at the web@0.0.0 start script 'babel-node tools/run start'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the web package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error     babel-node tools/run start
23 error You can get information on how to open an issue for this project with:
23 error     npm bugs web
23 error Or if that isn't available, you can get their info via:
23 error     npm owner ls web
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]

服务器在当天早些时候工作正常。我无法理解此调试日志中的确切问题。 感谢您的帮助。

1 个答案:

答案 0 :(得分:0)

通过阅读错误,看起来您没有安装babel节点工具。我用谷歌搜索它,看起来你可以从命令提示符执行此操作:npm install -g babel-cli。

为了清晰起见,

编辑

看起来这些线条发生了好几次:

10 verbose lifecycle web@0.0.0~start: CWD: C:\Users\Rohan-PC\Desktop\main  
11 silly lifecycle web@0.0.0~start: Args: [ '/d /s /c', 'babel-node tools/run start' ]  
12 silly lifecycle web@0.0.0~start: Returned: code: 1  signal: null  

对我来说,看起来像npm试图加载babel节点工具,但在找到它时找到null。

source