cypress cache clear hanging - node.js

For context I am working in windows 10 with Node.js.
Having set up cypress successfully after a load of trial and error in one project file I am starting from scratch with another project file to work out the exact steps.
For some reason it is failing with the new attempt and having noticed the errors show v 7/3/0 whereas the errors for the previous showed v 7.2.0 I thought I'd return to the first project file and try
cypress clear cache as recommended at docs.cypress.io/guides/references/troubleshooting which I've assumed that was to be run at the Node.js command prompt.
Having done so Node.js is just hanging.
Is this expected behaviour?
Have I misunderstood the instructions?
Thanks

Related

Cypress verification timed out after 30000 milliseconds

I am using cypress 5.0 in JS project. When I try to run npx cypress open keep getting error verification timed out after 30000 milliseconds.
Node version: v12.18.2
OS: Windows 7
Cypress : 5.0.0
I have downgraded to Cypress 4.0.0 and downgraded my node too. But keep getting the error. Please find the screenshot below. 2
I had a similar issue and I used the npx cypress verify to carry out the verification.
This happens because there's a verification that's meant to happen for first-time users but for some reason, the verification process times out.so one way to make the verification work is by using the npx cypress verify package.
This issue is not related to Cypress version. To resolve it, you need to increase the default timeout.
Open node_modules\cypress\lib\tasks\verify.js, search for VERIFY_TEST_RUNNER_TIMEOUT_MS and change it from 30000 (default) to 100000.
Save the file, then try to open the runner.
Retrying launching Cypress one more time worked out with the error being gone, hmm...
From Cypress version 9.2.0, you no longer have to change the timeout value in node_modules\cypress\lib\tasks\verify.js file manually.
Instead, you can utilize an environment variable called CYPRESS_VERIFY_TIMEOUT "to override the timeout duration of the verify command". Here is the link to the documentation about cypress verify command that mentions it.
Even better, starting from version 9.3.0, we can set the environment variable in a project's package.json or .npmrc (or .yarnrc) file.
Using this environment variable to increase the timeout (3 minutes for us) was necessary for us to ensure stability in our CI testing pipeline.
It's all due the Cache. Clear the cache it will automatically set.
I got the solution from this article. Follow the last step:
npm cache clean --force
https://softans.com/clear-cache-file-in-cypress/
Rerun it. It will work.
Rerunning it verified the cypress.
I had the same problem, running Cypress in WSL 2 would throw the same error even after trying all the solutions here.
I realised my Xserver was not running, started it up and everything worked again.
Please try this
go to path: node_modules\cypress\lib\tasks\verify.js, and you need to increase the default timeout.
Open verify.js, search for the variable VERIFY_TEST_RUNNER_TIMEOUT_MS. By default it should be 30000. Change it to 100000.
Save and try to open the runner. I hope now you will able to run the tests.
To resolve this issue, you need to increase default timeout. For this, go to below path: node_modules\cypress\lib\tasks\verify.js & Open verify.js, search variable VERIFY_TEST_RUNNER_TIMEOUT_MS. By default it should be 30000. Change it to 100000.
I also got this error , so I relaunch the cypress again(Which works for me) and also to be on safe side i have change the default duration with 100000s for future.
I just had the same problem, I solved it just by disabling the antivirus [Windows 10].
1st time using this tool today on my CentOS system.
Got the same error when trying to run cypress open and cypress verify.
Tried clearing the cache, reinstalling and all that fun stuff.
Nothing fixed it.
Note: I had VSCode running on my system and I had recently started the Angular ng test to test other tests.
Apparently something with ng test interferes with Cypress. Once I turned off ng test and tried to open and verify Cypress it worked.
Cypress 9.1.1
Problem with Windows was restarting the terminal, probably the PATH was not correctly updated.

Node JS Randomly stops executing - Shows no errors

I am not sure where to start looking for the issue here.
I recently updated from angular 5 to angular 8. The application runs fine after the update. I don't know if this is related.
All of the sudden, my Node JS scripts stop seemingly at random. Sometimes they run, usually they don't. This is any script.
By "Stopping" I mean the console, mid execution, leaves the last line it wrote up, and on the next line, I am able to write more commands.
Example:
C:\location\> npm start
ng serve --aot
** Angular Live development server is listening on .....*
12 % building 22/23 modules 1 active ...somefile.ts
C:\location\>
There is no error, even when I run --verbose. Also, if I have multiple windows up or multiple servers running, they all stop at the same time. It is happening regardless of the application or package, including http-server, Angular, and installing dependencies.
I couldn't find anything related online. Has anyone ever seen this?
Update:
The issue is caused by my lack of CPU.
I thought I fixed it by updating, but that didn't work.
----------- (previous reply, not a solution)
It appears some of my installed dependency versions conflicted with package.json. Basically something did not fully update as expected.
I resolved the issue by running npm install.

Angular application throws exception at compile time

I have an Angular 2 application, running in Electron and using Knex for database interaction that has successfully compiled and run several times over. After several edits, I attempted to run the application locally and received the error ReferenceError: "yexecutor is not defined".
Googling the error yielded no results. I have gradually commented out every line of custom code written by me and still the error occurs. I've even rebooted my rig thinking, perhaps, Node was just acting up. After a reboot, I'm still getting the error.
After commenting all of my own code, rebooting and finally dying and coming back to life to try again, I remembered I was investigating the source of some of the packages I had installed. So, I decided to try deleting the node_modules directory and execute an npm install.
A few minutes later, I'm back to a successful compile!
Steps to solve:
Delete node_modules
npm install
I must have fat fingered the keyboard while meandering through the packages! That, or my cats decided to become contributors.
Viola!

The lightest possible nodejs build

I'm trying to run a small nodejs project on a old router (A part of a challenge) but have ran into problems, as it only has about 6MB of usable memory. First off I ran the build through upx that took the build down to around 6mb. After that I tried using older builds iojs and v1.01. They worked fine except that they lacked features required to run the ws module (the other part of the challenge). After that I ran ./configure with the arguments of --without-dtrace --without-npm --without-etw --without-perfctr --with-icu-source=none but they still refused to bring down the build size. Is there a way to build nodejs in such a way that it runs the ws module and has an output that's under 6MB
Due to memory issue I think this will not work in your case.
Try this one espruino . Here You can read more detally
You should try CivetWeb: https://github.com/civetweb/civetweb It include Websocket and support javascript via Duktape.

Issue with Node-based Cordova Hook

I'm playing around with the Cordova hooks capabilities and I'm trying to test using a node application as a hook. In this article: http://devgirl.org/2013/11/12/three-hooks-your-cordovaphonegap-project-needs/ it references running node applications, so I know it's possible.
I've created a simple node application that I'm using to test the before prepare and after prepare process:
#! /usr/bin/env node
console.log("this is a node module");
When I run my prepare, I get the following error:
C:\Users\jwargo\dev\lunchmenu>cordova prepare
The system cannot find the path specified.
Hook failed with error code 1: C:\Users\jwargo\dev\lunchmenu\hooks\before_prepare\test.js
I can't find any information anywhere about what an error code of 1 means here.
I've tested the node code and it runs fine with "node test.js" and when I execute test.js from the command line Windows simply launches my default editor.
So, can anyone tell me what I'm doing wrong or what I need to do to be able to execute a node application as a hook with the Cordova CLI?
Figured it out with some help from the Cordova dev team. The space in my shebang was causing the problem. I removed it and the problem went away.

Resources