【问题标题】:What is the issue "node" is working but "nodemon" is not woking on windows 7 64-bit in node.js?“node”工作但“nodemon”在node.js中的Windows 7 64位上不起作用是什么问题?
【发布时间】:2016-02-10 04:43:53
【问题描述】:

我是 node.js 的新手。 node 工作正常,但是当我安装 nodemon 软件包时,它给出了一个错误:exception in nodemon killing node,即使在全局安装时也是如此。

 22 Jun 13:07:29 - [nodemon] v1.3.7
 22 Jun 13:07:29 - [nodemon] to restart at any time, enter `rs`
 22 Jun 13:07:29 - [nodemon] watching: *.*
 22 Jun 13:07:29 - [nodemon] starting `node server.js`
 exception in nodemon killing node  
 Error: spawn cmd ENOENT
 at exports._errnoException (util.js:746:11)
 at Process.ChildProcess._handle.onexit (child_process.js:1053:32)
 at child_process.js:1144:20
 at process._tickCallback (node.js:355:11)

 ---------------------------------------------------------- 
 If appropriate, please file an error with the output from:
 $ node                     
 C:\Users\username\AppData\Roaming\npm\node_modules\nodemon\bin\nodemon.
 js server.js --dump
 At http://github.com/remy/nodemon/issues/new

【问题讨论】:

    标签: node.js


    【解决方案1】:

    可能的解决方案。

    1.权限

    问题可能在于您的文件权限。以 git bash 或 windows 方式执行,授予项目文件夹完全权限。

    $ chmod -R 777 [folder] 
    

    2。环境变量

    PATH 中缺少“C:\Windows\System32\”。

    Github issue

    3。重新安装

    使用 npm 完全删除 nodemon 并尝试重新安装。

    npm uninstall -g nodemon
    

    4.更新nodejs

    如果您有旧版本的 nodejs,请尝试更新它。我更喜欢完全删除 nodejs 并重新安装它。

    Step by steps to remove nodejs in windows

    注意:您的问题可能不够丰富,无法给出正确答案。如果这 2 个解决方案不起作用,请提供有关该问题的更多信息。

    【讨论】:

    • 在无意中清除了我的 Windows PATH 变量后,System32 路径丢失了。添加它后,spawn cmd错误消失了:)
    【解决方案2】:

    帮助 spawn 找到你的 nodemon.cmd,如下所示:

    var nodemonCmd = (process.platform == 'win32') ? 'node_modules\\.bin\\nodemon.cmd' : 'nodemon'
    myApp = spawn(nodemonCmd, ['build/server.bundle']);
    

    希望它有效:)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-03-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-10-23
      • 2012-06-11
      • 2013-11-10
      相关资源
      最近更新 更多