Error executing "npm run test" with cypress - cypress

I'm learning cypress, but I came across this error.
When running npm run test the cypress window open for a while, but a couple seconds later it close, then this error appears:
I already installed the lastest cypress version and it didn't work.

Try running cypress cache clear and then npm install cypress --save-dev again.
then try running it with ./node_modules/.bin/cypress open.

Can you try these steps:
Delete node_modules folder
Run npm install -D cypress
Run npx cypress open

SOLVED: The problem was admin permission. When the blank window opened for a while, I clicked on the windows and authorized it again as adm. It worked!
I had authorized as adm before, but I don't know why it was happening.
Thanks you all guys for trying to help me.

Related

Cypress won't start, blank screen. Mac m1

I recently started getting this error where cypress only shows a blank screen and I can't seem to figure it out yet.
I've tried:
removing/reinstalling node_modules
running yarn
My cypress version in package.json:
"cypress": "^10.3.0",
When I run yarn cypress I get this message, and cypress opens with a blank screen:
objc[35990]: Class WebSwapCGLLayer is implemented in both /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.framework/Versions/A/Frameworks/libANGLE-shared.dylib (0x222c25b50) and /Users/[username]/Library/Caches/Cypress/10.3.0/Cypress.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libGLESv2.dylib (0x10923d3c8). One of the two will be used. Which one is undefined.
I was able to get it running again, after clearing cypress cache.
npm uninstall -g cypress
npm i -g cypress#10.9
yarn cypress cache clear
yarn install
run with yarn cypress
https://docs.cypress.io/guides/references/troubleshooting#Clear-Cypress-cache

why 'npm run watch' not working correctly?

I have weird problem :
I am working on Laravel/Vue project and when I run npm run watch it run correctly and it do compile stuff when i save. the problem is after ~3min when i save it do run as it did compile stuff but nothing changed on the browser.
The solution found is that i have to run npm run watch or npm run dev every time.
does anybody have a solution for that ?
hope you can help.

Error while installing Cypress: Cypress cannot run because this binary file does not have executable permissions here:

Getting an error while installing Cypress.io. I followed the steps in the documentation and still getting the following error:
Cypress cannot run because this binary file does not have executable permissions here:
/Library/Caches/Cypress/6.8.0/Cypress.app/Contents/MacOS/Cypress
Reasons this may happen:
- node was installed as 'root' or with 'sudo'
- the cypress npm package as 'root' or with 'sudo'
Please check that you have the appropriate user permissions.
You can also try clearing the cache with 'cypress cache clear' and reinstalling.
The folder structure is app/e2e/, and basically right now only contains the yarn.lock & package.json.
Commands I ran were:
yarn init
yarn add cypress
yarn run cypress open
then tried:
sudo yarn add cypress
yarn run cypress open
still didn't work, so then I tried:
cypress cache clear
which still didn't work...
After following a few threads here on SO and some on the cypress repo, here's what helped me, and I hope it helps someone else.
In my case, I deleted the existing e2e folder(probably not needed) and then made a new e2e folder inside my app and then ran the following:
yarn init
yarn add cypress
yarn run cypress install // this was the key
yarn run cypress open
Now I get all the base files that come with a fresh install of cypress.

"NPM install" command line cannot run in LARAVEL project directory

I want to work with webpack and Laravel
I'm trying to install Mix in my Laravel project.
So i have installed node and npm succesfully.
When i run node -v and npm -v in vscode it show me the version number so i think the install is ok.
But when i go in the Laravel project directory and try to run "npm -v" or "npm install" i have a message like "npm: The term 'npm' is not recognized as the name of cmdlet, function, file
script or executable program"...
Did i do something wrong?
My bad...
I had another session of Vscode runnign on the other screen and i didnt see it.
I closed all vscode session and reboot and it work
Thank you very much!

Percy - Cypress - Error: Could not find browser revision 756035. Run "npm install" or "yarn install" to download a browser binary

Im trying to set up a simple visual test with cypress and Percy.
Following the tutorial I installed percy as part of my cypress package, however when I attempt to run.
npx percy exec -- cypress run. I am met with the message:
Error: Could not find browser revision 756035. Run "npm install" or "yarn install" to download a browser binary.
Anyone else had this issue?
May be worth noting, when I run npx cypress run, the tests run as expected.
Something went wrong with npm install process, most likely the decompress failed which does not return a error.
Easiest way is to remove node_modules and install again.

Resources