question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Jenkins Error "Error: spawn cmd ENOENT"

See original GitHub issue

Hi, I’m running Cypress on Jenkins in Windows and am experiencing strange behavior. When I first setup Cypress to run in a build, it ran fine, but every time after that, it fails with Error: spawn cmd NOENT

Also, I changed the user that Jenkins runs as and Cypress ran only the first time the build ran, but after the first run, I get the same errors.

Current behavior:

Opening Cypress…

{ Error: spawn cmd ENOENT
    at exports._errnoException (util.js:1024:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:192:19)
    at onErrorNT (internal/child_process.js:374:16)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)

  code: 'ENOENT',
  errno: 'ENOENT',
  syscall: 'spawn cmd',
  path: 'cmd',
  spawnargs: 
   [ '/c',
     'WMIC path win32_process get Name,Processid,ParentProcessId,Commandline' ] }
Error: spawn cmd ENOENT
    at exports._errnoException (util.js:1024:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:192:19)
    at onErrorNT (internal/child_process.js:374:16)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)

[?25hBuild step 'Execute Windows batch command' marked build as failure
Finished: FAILURE

Desired behavior:

I would like Cypress to run my tests inside of headless mode.

Steps to reproduce: (app code and test code)

I don’t have a public repo to recreate this. If need, I could let somebody take a look at my build server. I’m just executing ./node_modules/.bin/cypress run from a windows batch command inside of Jenkins.

Versions

Windows Server 2016 Cypress 3.2.0 Jenkins latest

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:23 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
bilegansorincommented, Jan 2, 2020

Not sure if it’s relevant but I’m having the same error when trying to integrate Cypress with Percy on macos:

[percy] percy has started.
events.js:177
      throw er; // Unhandled 'error' event
      ^

Error: spawn cypress ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)
    at onErrorNT (internal/child_process.js:456:16)
    at processTicksAndRejections (internal/process/task_queues.js:84:9)
Emitted 'error' event at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:270:12)
    at onErrorNT (internal/child_process.js:456:16)
    at processTicksAndRejections (internal/process/task_queues.js:84:9) {
  errno: 'ENOENT',
  code: 'ENOENT',
  syscall: 'spawn cypress',
  path: 'cypress',
  spawnargs: [
    'run',
    '--browser',
    'chrome',
    '--spec',
    'cypress/integration/Regression/partner_test_flow.js'
  ]
}
1reaction
akeresztesghcommented, Apr 8, 2019

here’s the script: “cypress:headless”: “./node_modules/.bin/cypress run” I changed it to: “cypress:headless”: “cypress run”

It gets me to the same spot (error)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Problem with npm start (error : spawn cmd ENOENT)
Go to search bar and write environment variables. You should see an option to called edit system environment variables or something similar.
Read more >
Common errors | npm Docs
The error Error: ENOENT, stat 'C:\Users\<user>\AppData\Roaming\npm' on Windows 7 is a consequence of joyent/node#8141, and is an issue with the Node installer ...
Read more >
Fatal error: spawn cmd ENOENT when I try to build /test with ...
The error occurs when I run the grunt command, in the “jsdoc:dist” (jsdoc) task (so I think the project is “jsdoc”).
Read more >
Webdriver-Manager Won'T Start - Error: Spawn Cmd Enoent
If you ever get this error the hotfix is to follow these steps: delete nodemodules folder; run command npm cache clean force; run...
Read more >
How to fix: npm ERR! enoent ENOENT: no such file or ...
If you ever get this error, the hotfix is to follow these steps: ... It should all work fine after that. If these...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found