Giter VIP home page Giter VIP logo

Comments (7)

flotwig avatar flotwig commented on May 31, 2024

Supposedly this can happen on Windows because of something to do with filename extensions: https://stackoverflow.com/questions/27688804/how-do-i-debug-error-spawn-enoent-on-node-js

I think that if you simply changed the cmd to cmd.exe on this line, the error might go away:

const proc = utils.spawn('cmd', ['/c', cmd], { detached: false, windowsHide: true })

from find-process.

jennifer-shehane avatar jennifer-shehane commented on May 31, 2024

@flotwig Is this not related to this issue? #9 Cypress is updating to the version that contains this fix, so it may fix this issue cypress-io/cypress#4087

from find-process.

flotwig avatar flotwig commented on May 31, 2024

@jennifer-shehane I don't think it's the same issue, this error was actually crashing the process

from find-process.

yibn2008 avatar yibn2008 commented on May 31, 2024

Supposedly this can happen on Windows because of something to do with filename extensions: https://stackoverflow.com/questions/27688804/how-do-i-debug-error-spawn-enoent-on-node-js

I think that if you simply changed the cmd to cmd.exe on this line, the error might go away:

const proc = utils.spawn('cmd', ['/c', cmd], { detached: false, windowsHide: true })

I don't have the environment to reproduce this issue, please verify if this change can fix the problem.

from find-process.

flotwig avatar flotwig commented on May 31, 2024

I haven't been able to reproduce it either :/

from find-process.

flotwig avatar flotwig commented on May 31, 2024

This actually seems to be happening when the user does not have C:\Windows\System32 in their PATH:

Would changing that line to the following be a good solution?

const proc = utils.spawn('C:\Windows\System32\cmd.exe', ['/c', cmd], { detached: false, windowsHide: true }) 

from find-process.

VladimirMerk avatar VladimirMerk commented on May 31, 2024

The error in windows is reproduced if the path to C:\Windows\System32 is missing in the system PATH variable.
The path can be restored in this way:

const CMDPath = path.resolve(env.WINDIR, path.sep+'system32');
const pathArray = (env?.PATH || '').split(path.delimiter);
pathArray.push(CMDPath);
process.env.PATH = pathArray.join(path.delimiter);

from find-process.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.