cypress
cypress copied to clipboard
npm ERR! code ELIFECYCLE
I wasn't able to fix this issue as I have done lots of research. I used npm cache clean --force, and removed node_modules, packages.json, and package-lock.json but nothing worked.
when I run the test it passes, but I still see the below error after test result on terminal.
(Run Finished)
Spec Tests Passing Failing Pending Skipped
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ × ATMSBDD\PlannedClosureEvent.feature 00:08 1 - 1 - - │
├────────────────────────────────────────────────────────────────────────────────────────────────┤
│ √ ATMSBDD\PlannedClosureEvent\Navigat 2ms - - - - - │
│ ionSteps.js │
├────────────────────────────────────────────────────────────────────────────────────────────────┤
│ √ ATMSBDD\PlannedClosureEvent\Planned 2ms - - - - - │
│ ClosureSteps.js │
├────────────────────────────────────────────────────────────────────────────────────────────────┤
│ √ ATMSBDD\TopTabBar.js 2ms - - - - - │
├────────────────────────────────────────────────────────────────────────────────────────────────┤
│ √ ATMSTests\tests.CreateTrafficEvent\ 00:45 1 1 - - - │
│ PlannedClosureEventTest.js │
├────────────────────────────────────────────────────────────────────────────────────────────────┤
│ √ Utility\CypressUtility.js 1ms - - - - - │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
× 1 of 6 failed (17%) 00:54 2 1 1 - -
npm ERR! code ELIFECYCLE
npm ERR! errno 3221225477
npm ERR! [email protected] triggerAllTests-headed: `npx cypress run --headed`
npm ERR! Exit status 3221225477
npm ERR!
npm ERR! Failed at the [email protected] triggerAllTests-headed script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\muhammad.zuhoor1\AppData\Roaming\npm-cache\_logs\2021-01-05T17_37_09_691Z-debug.log
PS C:\bit9prog\dev\cypress\ATMS>
================== debug log:
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'triggerAllTests-headed'
1 verbose cli ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [
4 verbose run-script 'pretriggerAllTests-headed',
4 verbose run-script 'triggerAllTests-headed',
4 verbose run-script 'posttriggerAllTests-headed'
4 verbose run-script ]
5 info lifecycle [email protected]~pretriggerAllTests-headed: [email protected]
6 info lifecycle [email protected]~triggerAllTests-headed: [email protected]
7 verbose lifecycle [email protected]~triggerAllTests-headed: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~triggerAllTests-headed: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\bit9prog\dev\cypress\ATMS\node_modules\.bin;C:\Program Files\Java\jdk-13.0.1\bin;C:\Program Files\Java\jdk-13.0.1\bin\server C:\Program Files (x86)\Common Files\Oracle\Java\javapath;;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\windows\CCM;C:\Program Files (x86)\Common Files\Hitachi ID\;C:\Program Files\Common Files\Hitachi ID\;C:\Program Files (x86)\Hyland\Alt ActiveX\;C:\Program Files (x86)\Pulse Secure\VC142.CRT\X64\;C:\Program Files (x86)\Pulse Secure\VC142.CRT\X86\;C:\Program Files\TortoiseSVN\bin;C:\Program Files (x86)\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\nodejs\;C:\Users\muhammad.zuhoor1\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Java\jdk-13.0.1\bin;C:\Program Files\Java\jdk-13.0.1\bin\server;C:\bit9prog\dev\gradle-6.0.1\bin;C:\Program Files\7-Zip;C:\Users\muhammad.zuhoor1\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\muhammad.zuhoor1\AppData\Roaming\npm
9 verbose lifecycle [email protected]~triggerAllTests-headed: CWD: C:\bit9prog\dev\cypress\ATMS
10 silly lifecycle [email protected]~triggerAllTests-headed: Args: [ '/d /s /c', 'npx cypress run --headed' ]
11 silly lifecycle [email protected]~triggerAllTests-headed: Returned: code: 3221225477 signal: null
12 info lifecycle [email protected]~triggerAllTests-headed: Failed to exec triggerAllTests-headed script
13 verbose stack Error: [email protected] triggerAllTests-headed: `npx cypress run --headed`
13 verbose stack Exit status 3221225477
13 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:315:20)
13 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:315:20)
13 verbose stack at maybeClose (internal/child_process.js:1048:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
14 verbose pkgid [email protected]
15 verbose cwd C:\bit9prog\dev\cypress\ATMS
16 verbose Windows_NT 10.0.18363
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "triggerAllTests-headed"
18 verbose node v14.15.3
19 verbose npm v6.14.9
20 error code ELIFECYCLE
21 error errno 3221225477
22 error [email protected] triggerAllTests-headed: `npx cypress run --headed`
22 error Exit status 3221225477
23 error Failed at the [email protected] triggerAllTests-headed script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 3221225477, true ]
=================
package.json
{
"name": "atms_automated_tests",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "node_modules\\.bin\\cypress run",
"triggerAllTests-headless": "npx cypress run",
"triggerAllTests-headed": "npx cypress run --headed",
"triggerAllTests-chrome": "npx cypress run --browser chrome",
"triggerAllTests-dashboard": "npx cypress run --record --key 430a1d71-2cbf-4fa5-a610-1cbb993f7b6b",
"triggerAllTests-ATMSPageObjModel": "npx cypress run --spec cypress/integration/ATMSTests/**",
"triggerAllTests-ATMSBDD": "npx cypress run --spec cypress/integration/ATMSBDD/**",
"delete-assets": "rmdir /s /Q \"mochawesome-report/assets\"",
"delete-mochawesome-report": "npm run delete-assets && del /F /Q \"mochawesome-report\""
},
"author": "Zuhoor",
"license": "ISC",
"devDependencies": {
"cypress": "^5.6.0",
"cypress-cucumber-preprocessor": "^4.0.0",
"cypress-iframe": "^1.0.1",
"mochawesome": "^6.2.1",
"multiple-cucumber-html-reporter": "^1.18.0"
},
"cypress-cucumber-preprocessor": {
"nonGlobalStepDefinitions": true,
"cucumberJson": {
"generate": true,
"outputFolder": "cypress/cucumber-json",
"filePrefix": "",
"fileSuffix": ".cucumber"
}
},
"dependencies": {
"mocha": "^8.2.1"
}
}
The tests did not pass, it clearly shows that this spec has failed × ATMSBDD\PlannedClosureEvent.feature
the issue is still there even if the test passes. below is the test result and then the error:
PS C:\bit9prog\dev\cypress\ATMS> npm run triggerAllTests-ATMSPageObjModel
> [email protected] triggerAllTests-ATMSPageObjModel C:\bit9prog\dev\cypress\ATMS
> npx cypress run --spec cypress/integration/ATMSTests/**
====================================================================================================
(Run Starting)
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Cypress: 5.6.0 │
│ Browser: Electron 85 (headless) │
│ Specs: 1 found (ATMSTests\tests.CreateTrafficEvent\PlannedClosureEventTest.js) │
│ Searched: cypress\integration\ATMSTests\** │
│ Experiments: experimentalSourceRewriting=true,experimentalFetchPolyfill=true │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
────────────────────────────────────────────────────────────────────────────────────────────────────
Running: ATMSTests\tests.CreateTrafficEvent\PlannedClosureEventTest.js (1 of 1)
ATMSPageObjModel
√ PlannedClosureEvent (31019ms)
1 passing (47s)
[mochawesome] Report JSON saved to C:\bit9prog\dev\cypress\ATMS\mochawesome-report\mochawesome.json
[mochawesome] Report HTML saved to C:\bit9prog\dev\cypress\ATMS\mochawesome-report\mochawesome.html
(Results)
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Tests: 1 │
│ Passing: 1 │
│ Failing: 0 │
│ Pending: 0 │
│ Skipped: 0 │
│ Screenshots: 0 │
│ Video: true │
│ Duration: 46 seconds │
│ Spec Ran: ATMSTests\tests.CreateTrafficEvent\PlannedClosureEventTest.js │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
(Video)
- Started processing: Compressing to 32 CRF
- Finished processing: C:\bit9prog\dev\cypress\ATMS\cypress\videos\ATMSTests\tests (10 seconds)
.CreateTrafficEvent\PlannedClosureEventTest.js.mp4
Compression progress: 100%
====================================================================================================
(Run Finished)
Spec Tests Passing Failing Pending Skipped
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ √ ATMSTests\tests.CreateTrafficEvent\ 00:46 1 1 - - - │
│ PlannedClosureEventTest.js │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
√ All specs passed! 00:46 1 1 - - -
npm ERR! code ELIFECYCLE
npm ERR! errno 3221225477
npm ERR! [email protected] triggerAllTests-ATMSPageObjModel: `npx cypress run --spec cypress/integration/ATMSTests/**`
npm ERR! Exit status 3221225477
npm ERR!
npm ERR! Failed at the [email protected] triggerAllTests-ATMSPageObjModel script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\muhammad.zuhoor1\AppData\Roaming\npm-cache\_logs\2021-01-05T18_21_44_029Z-debug.log
debug log
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'triggerAllTests-ATMSPageObjModel'
1 verbose cli ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [
4 verbose run-script 'pretriggerAllTests-ATMSPageObjModel',
4 verbose run-script 'triggerAllTests-ATMSPageObjModel',
4 verbose run-script 'posttriggerAllTests-ATMSPageObjModel'
4 verbose run-script ]
5 info lifecycle [email protected]~pretriggerAllTests-ATMSPageObjModel: [email protected]
6 info lifecycle [email protected]~triggerAllTests-ATMSPageObjModel: [email protected]
7 verbose lifecycle [email protected]~triggerAllTests-ATMSPageObjModel: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~triggerAllTests-ATMSPageObjModel: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\bit9prog\dev\cypress\ATMS\node_modules\.bin;C:\Program Files\Java\jdk-13.0.1\bin;C:\Program Files\Java\jdk-13.0.1\bin\server C:\Program Files (x86)\Common Files\Oracle\Java\javapath;;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\windows\CCM;C:\Program Files (x86)\Common Files\Hitachi ID\;C:\Program Files\Common Files\Hitachi ID\;C:\Program Files (x86)\Hyland\Alt ActiveX\;C:\Program Files (x86)\Pulse Secure\VC142.CRT\X64\;C:\Program Files (x86)\Pulse Secure\VC142.CRT\X86\;C:\Program Files\TortoiseSVN\bin;C:\Program Files (x86)\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\nodejs\;C:\Users\muhammad.zuhoor1\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Java\jdk-13.0.1\bin;C:\Program Files\Java\jdk-13.0.1\bin\server;C:\bit9prog\dev\gradle-6.0.1\bin;C:\Program Files\7-Zip;C:\Users\muhammad.zuhoor1\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\muhammad.zuhoor1\AppData\Roaming\npm
9 verbose lifecycle [email protected]~triggerAllTests-ATMSPageObjModel: CWD: C:\bit9prog\dev\cypress\ATMS
10 silly lifecycle [email protected]~triggerAllTests-ATMSPageObjModel: Args: [
10 silly lifecycle '/d /s /c',
10 silly lifecycle 'npx cypress run --spec cypress/integration/ATMSTests/**'
10 silly lifecycle ]
11 silly lifecycle [email protected]~triggerAllTests-ATMSPageObjModel: Returned: code: 3221225477 signal: null
12 info lifecycle [email protected]~triggerAllTests-ATMSPageObjModel: Failed to exec triggerAllTests-ATMSPageObjModel script
13 verbose stack Error: [email protected] triggerAllTests-ATMSPageObjModel: `npx cypress run --spec cypress/integration/ATMSTests/**`
13 verbose stack Exit status 3221225477
13 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:315:20)
13 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:315:20)
13 verbose stack at maybeClose (internal/child_process.js:1048:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
14 verbose pkgid [email protected]
15 verbose cwd C:\bit9prog\dev\cypress\ATMS
16 verbose Windows_NT 10.0.18363
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "triggerAllTests-ATMSPageObjModel"
18 verbose node v14.15.3
19 verbose npm v6.14.9
20 error code ELIFECYCLE
21 error errno 3221225477
22 error [email protected] triggerAllTests-ATMSPageObjModel: `npx cypress run --spec cypress/integration/ATMSTests/**`
22 error Exit status 3221225477
23 error Failed at the [email protected] triggerAllTests-ATMSPageObjModel script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 3221225477, true ]
what happens if you use single quotes around the spec wildcard?
npx cypress run --spec 'cypress/integration/ATMSTests/**'
Looking just at the exit code it seems close to #3958 which is hard to debug without being able to execute the code
I already tried the single quotes and double quotes around the spec wildcard, but didn't work
So it might be something crashing the electron on exit. Can you try newer Cypress versions
Sent from my iPhone
On Jan 5, 2021, at 13:45, Muhammadehsan2019 [email protected] wrote:
I already tried the single quotes and double quotes around the spec wildcard, but didn't work
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or unsubscribe.
@Muhammadehsan2019
- Is this a newly occuring issue? Was this previously working?
- Does this happen when you run locally also?
Also, you should not share your record key in a public place. There are reasons why this key should be kept secret as explained here: https://on.cypress.io/projects#Record-key
We strongly advise that you regenerate a new key since you have exposed your private record key. Instructions here: https://on.cypress.io/projects#Create-new-record-key
This is always occurring, I tried to re-install cypress, remove the node_modules, update cypress to a newer version, and update node.js to a new version, but nothing worked for me. Thanks for reminding me to change the record key.
hi guys i need a help i made code coverage for angular project. But whenever I made code coverage; npm error occurs. I want CI test integration with cypress. On github actions npm error blocks. So test fails. (Run Finished)
Spec Tests Passing Failing Pending Skipped
┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ ✔ ComponentsNotTest\gameSortTest.js 3ms - - - - - │ ├────────────────────────────────────────────────────────────────────────────────────────────────┤ │ ✔ ComponentsNotTest\index.js 2ms - - - - - │ ├────────────────────────────────────────────────────────────────────────────────────────────────┤ │ ✔ ComponentsNotTest\login.js 2ms - - - - - │ ├────────────────────────────────────────────────────────────────────────────────────────────────┤ │ ✔ ComponentsNotTest\logout.js 2ms - - - - - │ ├────────────────────────────────────────────────────────────────────────────────────────────────┤ │ ✔ ComponentsNotTest\singleGame.js 2ms - - - - - │ ├────────────────────────────────────────────────────────────────────────────────────────────────┤ │ ✖ LoginTest.js 01:08 2 - 1 - 1 │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ ✖ 1 of 6 failed (17%) 01:08 2 - 1 - 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] e2e:ci: ng run blom:e2e-ci
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] e2e:ci script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\arifo\AppData\Roaming\npm-cache_logs\2021-05-05T21_40_34_164Z-debug.log
I got the same errors
npm ERR! code ELIFECYCLE
npm ERR! errno 1
...after running cypress open I was able to run the tests again in headless mode...
I'm experiencing the same error but I don't think the problem is with Cypress directly, rather the cypress-cucumber-preprocessor plugin. I notice the original poster is using the same plugin as me, but I'm using a much more recent combination (Cypress v10 and Cucumber Preprocessor v12).
I'm running the following command (I'm setting the browser for this but I encounter the issue no matter which browser I specify, however Chrome appears to return the most informative error message):
npx cypress run --browser chrome --spec 'cypress/e2e/basic-features/*'
I should note that using Electron as the browser returns the ELIFECYCLE message that @Muhammadehsan2019 has experienced above.
If I do the following in my package.json file:
"cypress-cucumber-preprocessor": {
"json": {
"enabled": false
}
}
Then I don't get the error at all and everything passes. If I set the value to true though, I get the following error returned:
An error was thrown in your plugins file while executing the handler for the after:run event.
The error we received was:
Error: spawn cucumber-json-formatter ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
at onErrorNT (internal/child_process.js:465:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
Here are the dependencies I have in my package.json for reference:
"dependencies": {
"@badeball/cypress-cucumber-preprocessor": "^12.0.0",
"@bahmutov/cypress-esbuild-preprocessor": "^2.1.3",
"cypress": "^10.4.0",
"oracledb": "^5.4.0",
"typescript": "^4.7.4"
},
"cypress-cucumber-preprocessor": {
"json": {
"enabled": true
}
},
"devDependencies": {
"cross-env": "^7.0.3"
}
EDIT: So I've been investigating this further locally and confirmed that this likely relates to the required Cucumber JSON Formatter not being installed or referenced correctly in the project, and it's required to make the cypress-cucumber-preprocessor generate cucumber.json files correctly.
I've done the following in my package.json file and I no longer get the error (after following these instructions):
"cypress-cucumber-preprocessor": {
"json": {
"enabled": true,
"formatter": "C:\\cucumberformatter\\cucumber-json-formatter.exe"
}
},
Are there any updates/workarounds for this one? We encounter it randomly when we install and run cypress from the base image.
FROM cypress/base:12
RUN apt-get update && \
apt-get install --no-install-recommends -y \
curl \
# clean up
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean
COPY package*.json cypress.config.js .eslintrc.json ./
COPY ./node_modules ./node_modules
RUN npm i
COPY ./cypress ./cypress
...
CMD ["/usr/local/bin/entrypoint.sh"]
The error:
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/**********-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] cypress:run: `cypress run`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] cypress:run script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/**********-debug.log
Sadly, I don't have access to this file ⬆️ after CI run is over.
This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.
Any Update or Workaround for this one yet?