Uncaught exception error spawn

Error on windows updates — spawn setup.exe EACCES #3623 Comments Version: builder v20.38.5 and updater v4.0.6 Target: —win —x64 —ia32 Hi @develar , I have donated in hopes of raising the priority on this issue. It is creating a bit of a large problem with our app that we are trying to release updates […]

Содержание

  1. Error on windows updates — spawn setup.exe EACCES #3623
  2. Comments
  3. spawn EAGAIN produces a sequence of uncaught exceptions that cannot be handled #32943
  4. Comments
  5. What steps will reproduce the bug?
  6. How often does it reproduce? Is there a required condition?
  7. What is the expected behavior?
  8. What do you see instead?
  9. Additional information
  10. Why did this happen whenever I opened a python file #311
  11. Comments
  12. Footer
  13. Error on windows updates — spawn setup.exe EACCES #3623
  14. Comments
  15. Running MarkdownPreview throws uncaught exception: Error: spawn xdg-open ENOENT in WSL 2 with terminal Vim #199
  16. Comments

Error on windows updates — spawn setup.exe EACCES #3623

Version: builder v20.38.5 and updater v4.0.6

Target: —win —x64 —ia32

Hi @develar ,
I have donated in hopes of raising the priority on this issue. It is creating a bit of a large problem with our app that we are trying to release updates to.

Our apps current production version uses Electron v3.0.13, electron-builder v20.31.2, and electron-updater v3.0.3. Whenever we published an update of our app, all users now get the following error whenever the update-downloaded event runs:

This problem seems to only occur on Windows. It didn’t error on macOS, but I have yet to test Linux.

I guess it is a permissions issue. Running the application in administrator mode solves the problem, but this is not a good solutions for thousands of users of the application currently.

This looks like a similar issue: #3480

We’ve also tried publishing an update which upgrades electron-builder to the latest v20.38.5 and electron-updated to v4.0.6, but the same problem still occurs. I believe the broken version is currently in production, so I am not sure how repair this problem for the thousands of users currently using the broken version.

Reproduction steps

  1. Download and install version v2.0.0. This version uses builder v20.31.2, and updater v3.0.3
  2. Run the application. It will try to update to v3.0.1. This version uses builder v20.38.5 and updater v4.0.6.
  3. Observe the error.

You can see that this problem was resolved in the latest builder/updater versions by first installing v3.0.0 and seeing it successfully update to v3.0.1. Both of these use the latest builder v20.38.5 and updater v4.0.6.

How do we repair this problem for our existing users on the broken version so that they can automatically update without having to run the application in administrator mode? This would create a support nightmare if users have to manually work around this error.

The text was updated successfully, but these errors were encountered:

Источник

spawn EAGAIN produces a sequence of uncaught exceptions that cannot be handled #32943

  • Version: 12.16.1
  • Platform: Linux eb68db941f4a 5.3.0-1016-aws #17

18.04.1-Ubuntu SMP Fri Mar 27 20:11:52 UTC 2020 x86_64 GNU/Linux

  • Subsystem: child_process
  • What steps will reproduce the bug?

    Produced by code that looks like this:

    1. In an async function , we call child_process.spawn() .
    2. process.on(‘uncaughtException’) gets triggered with an EGAIN on the attempt to spawn the child process. The stack for this uncaught exception looks like [1]. Note that while the triggering condition was in an async function, it was not converted into a promise rejection as I would have expected. The fact that the following exceptions were reported after, despite having synchronous call-stacks back to our call to spawn makes me think this is happening outside JavaScript-land.
    3. Next, we get two identical uncaught exceptions, having a stack originating at our code calling spawn [2]. I suspect these are for stdout / stderr , respectively.

    How often does it reproduce? Is there a required condition?

    This was produced within a docker container on an

    80% loaded host with several hundred identical containers in operation.

    What is the expected behavior?

    EAGAIN exceptions thrown by spawn should be handle-able by user-space code and should not produce uncaught exceptions outside normal control flow.

    What do you see instead?

    As described above, what appears to be an un-handleable exception thrown outside normal control flow.

    Additional information

    I also note this comment that makes me suspect the libuv / node-core boundary: #21203 (comment)

    The text was updated successfully, but these errors were encountered:

    Источник

    Why did this happen whenever I opened a python file #311

    [coc.nvim] error: Uncaught exception: Error: spawn pyenv ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
    at onErrorNT (internal/child_process.js:469:16)
    [coc.nvim] error: Uncaught exception: Error: spawn python3.7 ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
    at onErrorNT (internal/child_process.js:469:16)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)
    Uncaught exception: Error: spawn python3.6 ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
    at onErrorNT (internal/child_process.js:469:16)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)
    Uncaught exception: Error: spawn C:Python27python.exe ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
    at onErrorNT (internal/child_process.js:469:16)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)

    The text was updated successfully, but these errors were encountered:

    If you use python3 on linux just replace python with python3 in spawn process

    © 2023 GitHub, Inc.

    You can’t perform that action at this time.

    You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.

    Источник

    Error on windows updates — spawn setup.exe EACCES #3623

    Version: builder v20.38.5 and updater v4.0.6

    Target: —win —x64 —ia32

    Hi @develar ,
    I have donated in hopes of raising the priority on this issue. It is creating a bit of a large problem with our app that we are trying to release updates to.

    Our apps current production version uses Electron v3.0.13, electron-builder v20.31.2, and electron-updater v3.0.3. Whenever we published an update of our app, all users now get the following error whenever the update-downloaded event runs:

    This problem seems to only occur on Windows. It didn’t error on macOS, but I have yet to test Linux.

    I guess it is a permissions issue. Running the application in administrator mode solves the problem, but this is not a good solutions for thousands of users of the application currently.

    This looks like a similar issue: #3480

    We’ve also tried publishing an update which upgrades electron-builder to the latest v20.38.5 and electron-updated to v4.0.6, but the same problem still occurs. I believe the broken version is currently in production, so I am not sure how repair this problem for the thousands of users currently using the broken version.

    Reproduction steps

    1. Download and install version v2.0.0. This version uses builder v20.31.2, and updater v3.0.3
    2. Run the application. It will try to update to v3.0.1. This version uses builder v20.38.5 and updater v4.0.6.
    3. Observe the error.

    You can see that this problem was resolved in the latest builder/updater versions by first installing v3.0.0 and seeing it successfully update to v3.0.1. Both of these use the latest builder v20.38.5 and updater v4.0.6.

    How do we repair this problem for our existing users on the broken version so that they can automatically update without having to run the application in administrator mode? This would create a support nightmare if users have to manually work around this error.

    The text was updated successfully, but these errors were encountered:

    Источник

    Running MarkdownPreview throws uncaught exception: Error: spawn xdg-open ENOENT in WSL 2 with terminal Vim #199

    I’m using Vim 8.1 inside of Ubuntu 20.04 running in WSL 2 using the latest pull from master at the time of writing this comment.

    Inside of WSL 1 this plugin worked great. It would open my default browser when running that command without having to do anything custom.

    But now within WSL 2 it fails to run :MarkdownPreview with:

    Turns out you need to install sudo apt-get install -y xdg-utils , and then things work fine. Although there is a

    5 second delay before it opens where as with WSL 1 it was instant.

    Might be worth adding something to the docs or wiki for such an issue in a WSL section.

    The text was updated successfully, but these errors were encountered:

    I have update README and improve the error message

    Turns out you need to install sudo apt-get install -y xdg-utils , and then things work fine. Although there is a

    5 second delay before it opens where as with WSL 1 it was instant.

    It doesn’t work well for me now in WSL2.
    I have changed ip and port, when I execute :MarkdownPreview , my chrome on windows10 will open with site http://172.30.39.164:8854/page/1 , and warn me :

    This site can’t be reached
    172.30.39.164 refused to connect.
    Try:
    Checking the connection
    Checking the proxy and the firewall
    ERR_CONNECTION_REFUSED

    What can I do to solve it?

    I didn’t change my ip:port and it works here with an address of http://127.0.0.1:8576/page/1 , although there is still a multi-second delay for it to open. I’m running commit faacfbcefe88badb0a5bee3290ec690373552f2b of this plugin.

    I would try disabling Windows defender / firewall to see if that fixes anything.

    hahahahahhahaha. I have solved it!

    I have execute lsof -i in WSL2, and this plugin is listening localhost but not IP address , WSL2 treats Windows as a stand-alone host, so the connection from Windows is refused.

    Add let g:mkdp_open_to_the_world = 1 to init.vim will solve this problem!

    I just wanted to mention, using WSL2 (Arch if that makes a difference) the above methods did not work for me.

    What DID work was to install wslu and set
    g:mkdp_browser=’wslview’
    in my vimrc (well, init.vim). I have not experienced the multi-second delays the others are talking about using this approach.

    There is my solution:
    sudo ln -s /mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe /usr/bin/edge
    let let g:mkdp_browser = ‘edge’

    I just wanted to mention, using WSL2 (Arch if that makes a difference) the above methods did not work for me.

    What DID work was to install wslu and set
    g:mkdp_browser=’wslview’
    in my vimrc (well, init.vim). I have not experienced the multi-second delays the others are talking about using this approach.

    @ndaman it works on my debian wsl2, mostly perfect except that my terminal window will go blank after i start preview, then it gradually reloads everything when i make some mouse or keyboard movement. no big deal but kinda annoying.

    @XeonChow it can be solved by using wsl-open instead of wslview . Install wsl-open and set g:mkdp_browser=’wsl-open’

    If you prefer a general vim setting to a WSL specified one, use this trick without modifying g:mkdp_browser

    Just run :MarkdownPreview and you should be good to go.

    @XeonChow it can be solved by using wsl-open instead of wslview . Install wsl-open and set g:mkdp_browser=’wsl-open’

    If you prefer a general vim setting to a WSL specified one, use this trick without modifying g:mkdp_browser

    Just run :MarkdownPreview and you should be good to go.

    @qingbyin
    thank yuo so much, i followed your instruction and it works flawlessly.

    I didn’t change my ip:port and it works here with an address of http://127.0.0.1:8576/page/1 , although there is still a multi-second delay for it to open. I’m running commit faacfbcefe88badb0a5bee3290ec690373552f2b of this plugin.

    I would try disabling Windows defender / firewall to see if that fixes anything.

    @XeonChow it can be solved by using wsl-open instead of wslview . Install wsl-open and set g:mkdp_browser=’wsl-open’

    If you prefer a general vim setting to a WSL specified one, use this trick without modifying g:mkdp_browser

    Just run :MarkdownPreview and you should be good to go.

    There is my solution:
    sudo ln -s /mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe /usr/bin/edge
    let let g:mkdp_browser = ‘edge’

    If anyone is looking for a solution that doesn’t require installing wsl-open , modifying your vimrc or creating a symlink you can set up this alias: alias open=»/c/Program Files (x86)/Google/Chrome/Application/chrome.exe»

    I’ve been doing this on WSL 2 for months and running :MarkdownPreview works.

    I use this plugin in WSL1, ubuntu. Every time I input :MarkdownPreview , the statusline shows » openning ‘http://127.0.0.1:8781/page/5’ . done! (xdg-open)«. And I have to type this address in my browser to view my markdown.

    I would like to ask how to make the preview page show automatically? Thank you very much.

    @ndaman it works on my debian wsl2, mostly perfect except that my terminal window will go blank after i start preview, then it gradually reloads everything when i make some mouse or keyboard movement. no big deal but kinda annoying.

    @XeonChow Another way to solve is to redraw! in the last line of the function pointed by g:mkdp_browserfunc

    This is working on WSL2(Ubuntu 22.04) on a x64 machine.
    This opens using Chrome by default, and switch to Edge if Chrome not found.

    I use this plugin in WSL1, ubuntu. Every time I input :MarkdownPreview, the statusline shows » openning ‘http://127.0.0.1:8781/page/5’ . done! (xdg-open)». And I have to type this address in my browser to view my markdown.

    I would like to ask how to make the preview page show automatically? Thank you very much.

    @johnsonkee I guess your settings is broken.

    When I was testing, I encountered this as well. And it turned out that I made mistakes. Furthermore, even if silent is not used, error messages regarding to the call to browser hide behind vim.

    Источник

    • Version: 12.16.1
    • Platform: Linux eb68db941f4a 5.3.0-1016-aws #17~18.04.1-Ubuntu SMP Fri Mar 27 20:11:52 UTC 2020 x86_64 GNU/Linux
    • Subsystem: child_process

    What steps will reproduce the bug?

    Produced by code that looks like this:

        this.process = spawn(this.command, this.commandArgs, {
          env: this.env,
        });
    
        this.process.once('exit', this.onProcessExit);
        this.process.stdout.on('data', this.onProcessStdOut);
        this.process.stderr.on('data', this.onProcessStdErr);
    1. In an async function, we call child_process.spawn().
    2. process.on('uncaughtException') gets triggered with an EGAIN on the attempt to spawn the child process. The stack for this uncaught exception looks like [1]. Note that while the triggering condition was in an async function, it was not converted into a promise rejection as I would have expected. The fact that the following exceptions were reported after, despite having synchronous call-stacks back to our call to spawn makes me think this is happening outside JavaScript-land.
    3. Next, we get two identical uncaught exceptions, having a stack originating at our code calling spawn [2]. I suspect these are for stdout / stderr, respectively.

    How often does it reproduce? Is there a required condition?

    This was produced within a docker container on an ~80% loaded host with several hundred identical containers in operation.

    What is the expected behavior?

    EAGAIN exceptions thrown by spawn should be handle-able by user-space code and should not produce uncaught exceptions outside normal control flow.

    What do you see instead?

    As described above, what appears to be an un-handleable exception thrown outside normal control flow.

    Additional information

    Stack traces:

    1:

    uncaught exception Error: spawn /usr/local/bin/node EAGAIN
        at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
        at onErrorNT (internal/child_process.js:469:16)
        at processTicksAndRejections (internal/process/task_queues.js:84:21)
    

    2:

    uncaught exception Error: read ENOTCONN
        at tryReadStart (net.js:567:20)
        at Socket._read (net.js:578:5)
        at Socket.Readable.read (_stream_readable.js:478:10)
        at Socket.read (net.js:618:39)
        at new Socket (net.js:372:12)
        at Object.Socket (net.js:263:41)
        at createSocket (internal/child_process.js:314:14)
        at ChildProcess.spawn (internal/child_process.js:437:23)
        at spawn (child_process.js:548:9)
        at SandboxRuntime.spawn (/path/to/out/call/to/spawn.js:123:45)
    

    I also note this comment that makes me suspect the libuv / node-core boundary: #21203 (comment)

    • Forums

    • Community

    • Technology

    • Technology Q&A

    You are using an out of date browser. It may not display this or other websites correctly.
    You should upgrade or use an alternative browser.

    [Fixed] Node.js install ws unknown error?


    • Thread starter
      FirefighterKyle

    • Start date
      Sep 29, 2015

    • Tags

      agario

      node.js

    FirefighterKyle


    • #1

    So I am trying to make a private server for some friends and myself on Agar.io, I downloaded node.js and also python 3.5.0. I typed this command in my windows command prompt (cdm) «npm install ws» but end up with this error?

    C:Documents and Settingspcuser>npm install ws
    
    > [email protected] install C:Documents and Settingspcusernode_moduleswsnode_m
    odulesbufferutil
    > node-gyp rebuild
    
    
    C:Documents and Settingspcusernode_moduleswsnode_modulesbufferutil>if not de
    fined npm_config_node_gyp (node "E:AgarOgar-mastersrcnodejsnode_modulesnpm
    binnode-gyp-bin\....node_modulesnode-gypbinnode-gyp.js" rebuild )  else
    (node  rebuild )
    gyp ERR! UNCAUGHT EXCEPTION
    gyp ERR! stack Error: spawn UNKNOWN
    gyp ERR! stack     at exports._errnoException (util.js:837:11)
    gyp ERR! stack     at ChildProcess.spawn (internal/child_process.js:298:11)
    gyp ERR! stack     at exports.spawn (child_process.js:339:9)
    gyp ERR! stack     at exports.execFile (child_process.js:141:15)
    gyp ERR! stack     at checkPythonVersion (E:AgarOgar-mastersrcnodejsnode_mo
    dulesnpmnode_modulesnode-gyplibconfigure.js:86:5)
    gyp ERR! stack     at E:AgarOgar-mastersrcnodejsnode_modulesnpmnode_modul
    esnode-gyplibconfigure.js:53:9
    gyp ERR! stack     at E:AgarOgar-mastersrcnodejsnode_modulesnpmnode_modul
    eswhichwhich.js:82:18
    gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:82:15)
    gyp ERR! System Windows_NT 5.1.2600
    gyp ERR! command "E:\Agar\Ogar-master\src\nodejs\node.exe" "E:\Agar\Ogar-
    master\src\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js
    " "rebuild"
    gyp ERR! cwd C:Documents and Settingspcusernode_moduleswsnode_modulesbufferu
    til
    gyp ERR! node -v v4.1.1
    gyp ERR! node-gyp -v v3.0.3
    gyp ERR! This is a bug in `node-gyp`.
    gyp ERR! Try to update node-gyp and file an Issue if it does not help:
    gyp ERR!     <https://github.com/nodejs/node-gyp/issues>
    
    > [email protected] install C:Documents and Settingspcusernode_moduleswsno
    de_modulesutf-8-validate
    > node-gyp rebuild
    
    
    C:Documents and Settingspcusernode_moduleswsnode_modulesutf-8-validate>if no
    t defined npm_config_node_gyp (node "E:AgarOgar-mastersrcnodejsnode_modules
    npmbinnode-gyp-bin\....node_modulesnode-gypbinnode-gyp.js" rebuild )  e
    lse (node  rebuild )
    gyp ERR! UNCAUGHT EXCEPTION
    gyp ERR! stack Error: spawn UNKNOWN
    gyp ERR! stack     at exports._errnoException (util.js:837:11)
    gyp ERR! stack     at ChildProcess.spawn (internal/child_process.js:298:11)
    gyp ERR! stack     at exports.spawn (child_process.js:339:9)
    gyp ERR! stack     at exports.execFile (child_process.js:141:15)
    gyp ERR! stack     at checkPythonVersion (E:AgarOgar-mastersrcnodejsnode_mo
    dulesnpmnode_modulesnode-gyplibconfigure.js:86:5)
    gyp ERR! stack     at E:AgarOgar-mastersrcnodejsnode_modulesnpmnode_modul
    esnode-gyplibconfigure.js:53:9
    gyp ERR! stack     at E:AgarOgar-mastersrcnodejsnode_modulesnpmnode_modul
    eswhichwhich.js:82:18
    gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:82:15)
    gyp ERR! System Windows_NT 5.1.2600
    gyp ERR! command "E:\Agar\Ogar-master\src\nodejs\node.exe" "E:\Agar\Ogar-
    master\src\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js
    " "rebuild"
    gyp ERR! cwd C:Documents and Settingspcusernode_moduleswsnode_modulesutf-8-v
    alidate
    gyp ERR! node -v v4.1.1
    gyp ERR! node-gyp -v v3.0.3
    gyp ERR! This is a bug in `node-gyp`.
    gyp ERR! Try to update node-gyp and file an Issue if it does not help:
    gyp ERR!     <https://github.com/nodejs/node-gyp/issues>
    npm WARN optional dep failed, continuing [email protected]
    npm WARN optional dep failed, continuing [email protected]
    [email protected] node_modulesws
    ├── [email protected]
    └── [email protected]
    
    C:Documents and Settingspcuser>

    Can anyone tell me what error I am getting because to me it doesn’t make sense.

    Adil


    • #3

    gyp ERR! UNCAUGHT EXCEPTION

    Update node-gyp

    This is a bug in `node-gyp`.
    gyp ERR! Try to update node-gyp and file an Issue if it does not help:

    FirefighterKyle


    • Thread starter
    • #4

    gyp ERR! UNCAUGHT EXCEPTION

    Update node-gyp

    This is a bug in `node-gyp`.
    gyp ERR! Try to update node-gyp and file an Issue if it does not help:

    I tried that, I did npm install -g node-gyp, it seemed like it updated or what not, if I did it incorrectly how can I update the files?

    Adil


    • #5

    Try running node-gyp -v, what is the version output by that?

    FirefighterKyle


    • Thread starter
    • #6

    Adil


    • #7

    Hmm, that’s strange. Do you have Visual Studio and all the appropriate SDK’s installed?
    This thread may help

    You must be registered for see links

    FirefighterKyle


    • Thread starter
    • #8

    I have vs but not sure on the sdk’s will have to check. Heading off to work but would like to get this resolved so I will pm you and we can sky or tv, if that would help resolve this problem faster, thanks for the help so far.

    • #9

    gyp ERR! UNCAUGHT EXCEPTION

    Update node-gyp

    This is a bug in `node-gyp`.
    gyp ERR! Try to update node-gyp and file an Issue if it does not help:

    Yes I got the same message when I installed it, but the module was still there + it worked perfectly.
    Its common to get NPM errors unless you’re using very well-known modules.

    FirefighterKyle


    • Thread starter
    • #10

    Yes I got the same message when I installed it, but the module was still there + it worked perfectly.
    Its common to get NPM errors unless you’re using very well-known modules.

    I don’t know how you got it working because when I try to run my Ogar-master for agar private server I get this error.

    E:AgarOgar-mastersrc>node index.js
    module.js:338
        throw err;
        ^
    
    Error: Cannot find module 'ws'
        at Function.Module._resolveFilename (module.js:336:15)
        at Function.Module._load (module.js:286:25)
        at Module.require (module.js:365:17)
        at require (module.js:384:17)
        at Object.<anonymous> (E:AgarOgar-mastersrcGameServer.js:2:17)
        at Module._compile (module.js:434:26)
        at Object.Module._extensions..js (module.js:452:10)
        at Module.load (module.js:355:32)
        at Function.Module._load (module.js:310:12)
        at Module.require (module.js:365:17)
    
    E:AgarOgar-mastersrc>pause
    Press any key to continue . . .

    • #11

    I don’t know how you got it working because when I try to run my Ogar-master for agar private server I get this error.

    E:AgarOgar-mastersrc>node index.js
    module.js:338
        throw err;
        ^
    
    Error: Cannot find module 'ws'
        at Function.Module._resolveFilename (module.js:336:15)
        at Function.Module._load (module.js:286:25)
        at Module.require (module.js:365:17)
        at require (module.js:384:17)
        at Object.<anonymous> (E:AgarOgar-mastersrcGameServer.js:2:17)
        at Module._compile (module.js:434:26)
        at Object.Module._extensions..js (module.js:452:10)
        at Module.load (module.js:355:32)
        at Function.Module._load (module.js:310:12)
        at Module.require (module.js:365:17)
    
    E:AgarOgar-mastersrc>pause
    Press any key to continue . . .

    You need to set directory before you run the NPM command… -_-

    cd E:AgarOgar-mastersrc
    npm install ws

    FirefighterKyle


    • Thread starter
    • #12

    You need to set directory before you run the NPM command… -_-

    cd E:AgarOgar-mastersrc
    npm install ws

    How to I set the directory?

    Adil


    • #13

    Run npm install -g ws, does that solve the problem?

    FirefighterKyle


    • Thread starter
    • #14

    Run npm install -g ws, does that solve the problem?

    Tried that no it still gives the same errors :l

    • #15

    Tried that no it still gives the same errors :l

    Run the selected command in the node command line before running the npm command

    cd E:AgarOgar-mastersrc

    FirefighterKyle


    • Thread starter
    • #16

    Run the selected command in the node command line before running the npm command

    cd E:AgarOgar-mastersrc

    Still getting this, I did cd E:Agar etc

    C:Documents and Settingspcuser>cd E:AgarOgar-mastersrc
    
    C:Documents and Settingspcuser>npm install ws
    
    > [email protected] install C:Documents and Settingspcusernode_moduleswsnode_m
    odulesbufferutil
    > node-gyp rebuild
    
    
    C:Documents and Settingspcusernode_moduleswsnode_modulesbufferutil>if not de
    fined npm_config_node_gyp (node "E:AgarOgar-mastersrcnodejsnode_modulesnpm
    binnode-gyp-bin\....node_modulesnode-gypbinnode-gyp.js" rebuild )  else
    (node  rebuild )
    gyp ERR! UNCAUGHT EXCEPTION
    gyp ERR! stack Error: spawn UNKNOWN
    gyp ERR! stack     at exports._errnoException (util.js:837:11)
    gyp ERR! stack     at ChildProcess.spawn (internal/child_process.js:298:11)
    gyp ERR! stack     at exports.spawn (child_process.js:339:9)
    gyp ERR! stack     at exports.execFile (child_process.js:141:15)
    gyp ERR! stack     at checkPythonVersion (E:AgarOgar-mastersrcnodejsnode_mo
    dulesnpmnode_modulesnode-gyplibconfigure.js:86:5)
    gyp ERR! stack     at E:AgarOgar-mastersrcnodejsnode_modulesnpmnode_modul
    esnode-gyplibconfigure.js:53:9
    gyp ERR! stack     at E:AgarOgar-mastersrcnodejsnode_modulesnpmnode_modul
    eswhichwhich.js:82:18
    gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:82:15)
    gyp ERR! System Windows_NT 5.1.2600
    gyp ERR! command "E:\Agar\Ogar-master\src\nodejs\node.exe" "E:\Agar\Ogar-
    master\src\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js
    " "rebuild"
    gyp ERR! cwd C:Documents and Settingspcusernode_moduleswsnode_modulesbufferu
    til
    gyp ERR! node -v v4.1.1
    gyp ERR! node-gyp -v v3.0.3
    gyp ERR! This is a bug in `node-gyp`.
    gyp ERR! Try to update node-gyp and file an Issue if it does not help:
    gyp ERR!     <https://github.com/nodejs/node-gyp/issues>
    
    > [email protected] install C:Documents and Settingspcusernode_moduleswsno
    de_modulesutf-8-validate
    > node-gyp rebuild
    
    
    C:Documents and Settingspcusernode_moduleswsnode_modulesutf-8-validate>if no
    t defined npm_config_node_gyp (node "E:AgarOgar-mastersrcnodejsnode_modules
    npmbinnode-gyp-bin\....node_modulesnode-gypbinnode-gyp.js" rebuild )  e
    lse (node  rebuild )
    gyp ERR! UNCAUGHT EXCEPTION
    gyp ERR! stack Error: spawn UNKNOWN
    gyp ERR! stack     at exports._errnoException (util.js:837:11)
    gyp ERR! stack     at ChildProcess.spawn (internal/child_process.js:298:11)
    gyp ERR! stack     at exports.spawn (child_process.js:339:9)
    gyp ERR! stack     at exports.execFile (child_process.js:141:15)
    gyp ERR! stack     at checkPythonVersion (E:AgarOgar-mastersrcnodejsnode_mo
    dulesnpmnode_modulesnode-gyplibconfigure.js:86:5)
    gyp ERR! stack     at E:AgarOgar-mastersrcnodejsnode_modulesnpmnode_modul
    esnode-gyplibconfigure.js:53:9
    gyp ERR! stack     at E:AgarOgar-mastersrcnodejsnode_modulesnpmnode_modul
    eswhichwhich.js:82:18
    gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:82:15)
    gyp ERR! System Windows_NT 5.1.2600
    gyp ERR! command "E:\Agar\Ogar-master\src\nodejs\node.exe" "E:\Agar\Ogar-
    master\src\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js
    " "rebuild"
    gyp ERR! cwd C:Documents and Settingspcusernode_moduleswsnode_modulesutf-8-v
    alidate
    gyp ERR! node -v v4.1.1
    gyp ERR! node-gyp -v v3.0.3
    gyp ERR! This is a bug in `node-gyp`.
    gyp ERR! Try to update node-gyp and file an Issue if it does not help:
    gyp ERR!     <https://github.com/nodejs/node-gyp/issues>
    npm WARN optional dep failed, continuing [email protected]
    npm WARN optional dep failed, continuing [email protected]
    [email protected] node_modulesws
    ├── [email protected]
    └── [email protected]
    
    C:Documents and Settingspcuser>

    • #17

    Still getting this, I did cd E:Agar etc

    C:Documents and Settingspcuser>cd E:AgarOgar-mastersrc
    
    C:Documents and Settingspcuser>npm install ws
    
    > [email protected] install C:Documents and Settingspcusernode_moduleswsnode_m
    odulesbufferutil
    > node-gyp rebuild
    
    
    C:Documents and Settingspcusernode_moduleswsnode_modulesbufferutil>if not de
    fined npm_config_node_gyp (node "E:AgarOgar-mastersrcnodejsnode_modulesnpm
    binnode-gyp-bin\....node_modulesnode-gypbinnode-gyp.js" rebuild )  else
    (node  rebuild )
    gyp ERR! UNCAUGHT EXCEPTION
    gyp ERR! stack Error: spawn UNKNOWN
    gyp ERR! stack     at exports._errnoException (util.js:837:11)
    gyp ERR! stack     at ChildProcess.spawn (internal/child_process.js:298:11)
    gyp ERR! stack     at exports.spawn (child_process.js:339:9)
    gyp ERR! stack     at exports.execFile (child_process.js:141:15)
    gyp ERR! stack     at checkPythonVersion (E:AgarOgar-mastersrcnodejsnode_mo
    dulesnpmnode_modulesnode-gyplibconfigure.js:86:5)
    gyp ERR! stack     at E:AgarOgar-mastersrcnodejsnode_modulesnpmnode_modul
    esnode-gyplibconfigure.js:53:9
    gyp ERR! stack     at E:AgarOgar-mastersrcnodejsnode_modulesnpmnode_modul
    eswhichwhich.js:82:18
    gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:82:15)
    gyp ERR! System Windows_NT 5.1.2600
    gyp ERR! command "E:\Agar\Ogar-master\src\nodejs\node.exe" "E:\Agar\Ogar-
    master\src\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js
    " "rebuild"
    gyp ERR! cwd C:Documents and Settingspcusernode_moduleswsnode_modulesbufferu
    til
    gyp ERR! node -v v4.1.1
    gyp ERR! node-gyp -v v3.0.3
    gyp ERR! This is a bug in `node-gyp`.
    gyp ERR! Try to update node-gyp and file an Issue if it does not help:
    gyp ERR!     <https://github.com/nodejs/node-gyp/issues>
    
    > [email protected] install C:Documents and Settingspcusernode_moduleswsno
    de_modulesutf-8-validate
    > node-gyp rebuild
    
    
    C:Documents and Settingspcusernode_moduleswsnode_modulesutf-8-validate>if no
    t defined npm_config_node_gyp (node "E:AgarOgar-mastersrcnodejsnode_modules
    npmbinnode-gyp-bin\....node_modulesnode-gypbinnode-gyp.js" rebuild )  e
    lse (node  rebuild )
    gyp ERR! UNCAUGHT EXCEPTION
    gyp ERR! stack Error: spawn UNKNOWN
    gyp ERR! stack     at exports._errnoException (util.js:837:11)
    gyp ERR! stack     at ChildProcess.spawn (internal/child_process.js:298:11)
    gyp ERR! stack     at exports.spawn (child_process.js:339:9)
    gyp ERR! stack     at exports.execFile (child_process.js:141:15)
    gyp ERR! stack     at checkPythonVersion (E:AgarOgar-mastersrcnodejsnode_mo
    dulesnpmnode_modulesnode-gyplibconfigure.js:86:5)
    gyp ERR! stack     at E:AgarOgar-mastersrcnodejsnode_modulesnpmnode_modul
    esnode-gyplibconfigure.js:53:9
    gyp ERR! stack     at E:AgarOgar-mastersrcnodejsnode_modulesnpmnode_modul
    eswhichwhich.js:82:18
    gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:82:15)
    gyp ERR! System Windows_NT 5.1.2600
    gyp ERR! command "E:\Agar\Ogar-master\src\nodejs\node.exe" "E:\Agar\Ogar-
    master\src\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js
    " "rebuild"
    gyp ERR! cwd C:Documents and Settingspcusernode_moduleswsnode_modulesutf-8-v
    alidate
    gyp ERR! node -v v4.1.1
    gyp ERR! node-gyp -v v3.0.3
    gyp ERR! This is a bug in `node-gyp`.
    gyp ERR! Try to update node-gyp and file an Issue if it does not help:
    gyp ERR!     <https://github.com/nodejs/node-gyp/issues>
    npm WARN optional dep failed, continuing [email protected]
    npm WARN optional dep failed, continuing [email protected]
    [email protected] node_modulesws
    ├── [email protected]
    └── [email protected]
    
    C:Documents and Settingspcuser>

    Check if you got the folder node_modules and if you do… run the program.
    Stop worrying about the fucking log -_-.

    EDIT: if not cd probably doesn’t work (that’s what its looking like) make sure your directory is set correctly.

    FirefighterKyle


    • Thread starter
    • #18

    The log wouldn’t bother me if the start button for ogar-master to make my private server wouldn’t keep saying need ws

    • #19

    Please check the directory C:Documents and Settingspcuser for node_modules

    FirefighterKyle


    • Thread starter
    • #20

    Edit:
    Fixed the problem, didn’t realize that I had to drag that folder into ogar-master. Thank you @Moonshine and @Adil for the support.

    Users who are viewing this thread

    • Forums

    • Community

    • Technology

    • Technology Q&A

    NOTE: This error is almost always caused because the command does not exist, because the working directory does not exist, or from a windows-only bug.

    I found a particular easy way to get the idea of the root cause of:

    Error: spawn ENOENT
    

    The problem of this error is, there is really little information in the error message to tell you where the call site is, i.e. which executable/command is not found, especially when you have a large code base where there are a lot of spawn calls. On the other hand, if we know the exact command that cause the error then we can follow @laconbass’ answer to fix the problem.

    I found a very easy way to spot which command cause the problem rather than adding event listeners everywhere in your code as suggested in @laconbass’ answer. The key idea is to wrap the original spawn call with a wrapper which prints the arguments send to the spawn call.

    Here is the wrapper function, put it at the top of the index.js or whatever your server’s starting script.

    (function() {
        var childProcess = require("child_process");
        var oldSpawn = childProcess.spawn;
        function mySpawn() {
            console.log('spawn called');
            console.log(arguments);
            var result = oldSpawn.apply(this, arguments);
            return result;
        }
        childProcess.spawn = mySpawn;
    })();
    

    Then the next time you run your application, before the uncaught exception’s message you will see something like that:

    spawn called
    { '0': 'hg',
      '1': [],
      '2':
       { cwd: '/* omitted */',
         env: { IP: '0.0.0.0' },
         args: [] } }
    

    In this way you can easily know which command actually is executed and then you can find out why nodejs cannot find the executable to fix the problem.

    Step 1: Ensure spawn is called the right way

    First, review the docs for child_process.spawn( command, args, options ):

    Launches a new process with the given command, with command line arguments in args. If omitted, args defaults to an empty Array.

    The third argument is used to specify additional options, which defaults to:

    { cwd: undefined, env: process.env }

    Use env to specify environment variables that will be visible to the new process, the default is process.env.

    Ensure you are not putting any command line arguments in command and the whole spawn call is valid. Proceed to next step.

    Step 2: Identify the Event Emitter that emits the error event

    Search on your source code for each call to spawn, or child_process.spawn, i.e.

    spawn('some-command', [ '--help' ]);
    

    and attach there an event listener for the ‘error’ event, so you get noticed the exact Event Emitter that is throwing it as ‘Unhandled’. After debugging, that handler can be removed.

    spawn('some-command', [ '--help' ])
      .on('error', function( err ){ throw err })
    ;
    

    Execute and you should get the file path and line number where your ‘error’ listener was registered. Something like:

    /file/that/registers/the/error/listener.js:29
          throw err;
                ^
    Error: spawn ENOENT
        at errnoException (child_process.js:1000:11)
        at Process.ChildProcess._handle.onexit (child_process.js:791:34)
    

    If the first two lines are still

    events.js:72
            throw er; // Unhandled 'error' event
    

    do this step again until they are not. You must identify the listener that emits the error before going on next step.

    Step 3: Ensure the environment variable $PATH is set

    There are two possible scenarios:

    1. You rely on the default spawn behaviour, so child process environment will be the same as process.env.
    2. You are explicity passing an env object to spawn on the options argument.

    In both scenarios, you must inspect the PATH key on the environment object that the spawned child process will use.

    Example for scenario 1

    // inspect the PATH key on process.env
    console.log( process.env.PATH );
    spawn('some-command', ['--help']);
    

    Example for scenario 2

    var env = getEnvKeyValuePairsSomeHow();
    // inspect the PATH key on the env object
    console.log( env.PATH );
    spawn('some-command', ['--help'], { env: env });
    

    The absence of PATH (i.e., it’s undefined) will cause spawn to emit the ENOENT error, as it will not be possible to locate any command unless it’s an absolute path to the executable file.

    When PATH is correctly set, proceed to next step. It should be a directory, or a list of directories. Last case is the usual.

    Step 4: Ensure command exists on a directory of those defined in PATH

    Spawn may emit the ENOENT error if the filename command (i.e, ‘some-command’) does not exist in at least one of the directories defined on PATH.

    Locate the exact place of command. On most linux distributions, this can be done from a terminal with the which command. It will tell you the absolute path to the executable file (like above), or tell if it’s not found.

    Example usage of which and its output when a command is found

    > which some-command
    some-command is /usr/bin/some-command
    

    Example usage of which and its output when a command is not found

    > which some-command
    bash: type: some-command: not found
    

    miss-installed programs are the most common cause for a not found command. Refer to each command documentation if needed and install it.

    When command is a simple script file ensure it’s accessible from a directory on the PATH. If it’s not, either move it to one or make a link to it.

    Once you determine PATH is correctly set and command is accessible from it, you should be able to spawn your child process without spawn ENOENT being thrown.

    Понравилась статья? Поделить с друзьями:
  • Uncaught exception error cannot find module
  • Uncaught error перевод
  • Uncaught error vk not initialized please use vk init
  • Uncaught error unable to initialize bitrix24 js library
  • Uncaught error syntax error unrecognized expression unsupported pseudo