Cypress failed to start Windows - cypress

I have installed Cypress on my Windows 10 machine.
From my project folder in VSCode Terminal window I first ran npm init -y
I then run the following command npm install cypress --force
I then run the command npx cypress open I get the following error
PS C:\Projects\Cypress Projects\QACypressDemo> npm install cypress --force
npm WARN using --force Recommended protections disabled.
npm WARN deprecated har-validator#5.1.5: this library is no longer supported
added 219 packages, and audited 220 packages in 37s
16 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
PS C:\Projects\Cypress Projects\QACypressDemo> npx cypress open
It looks like this is your first time using Cypress: 7.3.0
× Verifying Cypress can run C:\Users\Usera\AppData\Local\Cypress\Cache\7.3.0\Cypress
→ Cypress Version: 7.3.0
Cypress failed to start.
This is usually caused by a missing library or dependency.
The error below should indicate which dependency is missing.
https://on.cypress.io/required-dependencies
If you are using Docker, we provide containers with all required dependencies installed.
----------
#
# Fatal error in , line 0
# Failed to deserialize the V8 snapshot blob. This can mean that the snapshot blob file is corrupted or missing.
#
#
#
#FailureMessage Object: 000000BA300FEE30
1: 00007FF6C6C8BCCF node::OnFatalError+69935
2: 00007FF6C1AFE6CA Ordinal0+59082
3: 00007FF6C20ACEC8 v8::Isolate::Initialize+744
4: 00007FF6C2B6D48F v8::Isolate::AddMessageListenerWithErrorLevel+1039
5: 00007FF6C56D7583 std::__1::vector<v8::CpuProfileDeoptInfo,std::__1::allocator<v8::CpuProfileDeoptInfo> >::max_size+857811
6: 00007FF6C56CF89B std::__1::vector<v8::CpuProfileDeoptInfo,std::__1::allocator<v8::CpuProfileDeoptInfo> >::max_size+825835
7: 00007FF6C60DA382 v8_inspector::protocol::Binary::operator=+2434098
8: 00007FF6C60DDC29 v8_inspector::protocol::Binary::operator=+2448601
9: 00007FF6C60D9E12 v8_inspector::protocol::Binary::operator=+2432706
10: 00007FF6C5DFB2D0 v8::ExtensionConfiguration::ExtensionConfiguration+2964624
11: 00007FF6C5DFAEEA v8::ExtensionConfiguration::ExtensionConfiguration+2963626
12: 00007FF6C5DF9E57 v8::ExtensionConfiguration::ExtensionConfiguration+2959383
13: 00007FF6C5DFA17D v8::ExtensionConfiguration::ExtensionConfiguration+2960189
14: 00007FF6C5603167 uv_sleep+2434663
15: 00007FF6C803FF02 uv_random+10012786
16: 00007FFFCF1937E4 BaseThreadInitThunk+20
17: 00007FFFD10ECB81 RtlUserThreadStart+33
----------
Platform: win32 (10.0.16299)
Cypress Version: 7.3.0
I tried deleting the Cypress folder from and run the install command again. Cypress still fails to run
C:\Users\Usera\AppData\Local\cypress
Not sure why Cypress won't run, the test runner won't open. Any ideas. Thanks.

I`ve had such problems when an installation was interrupted mid-way. You can clear the cache and install it again. I used the following sequence:
cypress cache clear
npm install cypress --save-dev

npm install and npx cypress run the binaries in two different locations. If you want to use the binary you installed into the directory, you need to run the binary found in the node module folder. On Windows, if you run ./node_modules/.bin/cypress that should start up the version in your node modules folder.

Related

Cypress Error after running open command...'error loading V8 startup snapshot file'. I'm not able to run cypress then

The exact error is:
[0328/091115.205:FATAL:v8_initializer.cc(447)] Error loading V8 startup snapshot file
Could you please help to fix and be able to use Cypress?
I tried (steps):
First: C:/inetpub/wwwroot/cypress-example>npm install
Second: C:/inetpub/wwwroot/cypress-example>npx cypress run
(both command using cmd.exe as administrator permission and I was running it in the file of the website example that I criated...C:/inetpub/wwwroot/cyrpress-teste)
exact error bellow:
Cypress failed to start.
This may be due to a missing library or dependency. https://on.cypress.io/required-dependencies
Please refer to the error below for more details.
[0328/091115.205:FATAL:v8_initializer.cc(447)] Error loading V8 startup snapshot file
Platform: win32-x64 (10.0.19044)
Cypress Version: 9.5.2
I got the same error in cypress v9.5.4
Solved this by installing older version.
Just uninstall the current version, write "cypress": "^8.4.1" and run npm i

Can't properly install hardhat using Powershell! Persistent Error HH12: Trying to use a non-local installation of Hardhat, which is not supported

Below is a short list of my setup until I stumble upon the HH12 Hardhat Error that I keep getting:
mkdir wave (Name of my directory)
cd wave
npm init -y
npm install —save-dev hardhat
npx hardhat
Choose sample project
6a. Hardhat project root (Select)
6b. Add .gitignore
Say yes to everything
install the remaining dependencies: npm install --save-dev #nomiclabs/hardhat-waffle ethereum-waffle chai #nomiclabs/hardhat-ethers ethers
npx hardhat accounts (to see all the different accounts)...
...And then it fails here! An HH12 Hardhat Error Message: "Hardhat is not installed or installed globally. You tried to run Hardhat from a global installation or not installing it at all. This is not supported. Please install Hardhat locally using npm or Yarn, and try again." (https://hardhat.org/errors/) [BTW, these 2 lines are the ONLY docs on this error on Hardhat!].
Any suggestions?
I have tried the following possible 'fixes' to sidestep this error but to no avail:
Updating most current version of node
Restarting my PC (About 17 X now as of this writing)
Using GitBash (Instead of Powershell)
Asking mods in Hardhat Discord (None) and other Discords
Opening the Hardhat docs (And the Tutorials!!) for answers... None!
StackExchange - There's literally only 1 other person who ALSO had this problem here! But the answers here are not the solution. (Have DMd that person but no reply as of yet).
So can anyone out there help?
I believe I finally figured out the solution (at least what worked for me):
I dropped back 2 directory levels from where I was for my root project and started again there.
I updated my Node version to 16.

Running Cypress in Bitbucket pipelines fails looking for chrome

I have no idea why it tries to run Chrome instead of Electron based browser. Could be a Percy culprit here?
+ yarn cy:ci --parallel --ci-build-id $BITBUCKET_BUILD_NUMBER
yarn run v1.13.0
$ cd cypress && yarn ci --parallel --ci-build-id 119
$ percy exec -- cypress run --record --parallel --ci-build-id 119
[percy] created build #5: https://percy.io/DeepVision/doveze-cz/builds/1794467
Error: Failed to launch chrome!
/opt/atlassian/pipelines/agent/build/cypress/node_modules/puppeteer/.local-chromium/linux-650583/chrome-linux/chrome: error while loading shared libraries: libX11-xcb.so.1: cannot open shared object file: No such file or directory
TROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md
at onClose (/opt/atlassian/pipelines/agent/build/cypress/node_modules/puppeteer/lib/Launcher.js:342:14)
at Interface.helper.addEventListener (/opt/atlassian/pipelines/agent/build/cypress/node_modules/puppeteer/lib/Launcher.js:331:50)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
More info and configs at gist: https://gist.github.com/FredyC/d5b82b485e65245102dd24f6df787f5f
With the help from Percy support, this issue is overcome by using the image cypress/browsers:chrome67-ff57.

Failed at the # production script. Error running npm run production

I am facing issue while using the following command
npm run production
after execute following command i see following error
ERROR Failed to compile with 5 errors
error in ./resources/assets/sass/app.scss
Module build failed: ModuleBuildError: Module build failed: TypeError: Cannot read property 'map' of undefined
at preparePluginsArray (E:\wamp\www\smm.yasmalik.com\node_modules\svgo\lib\svgo\config.js:64:20)
at module.exports (E:\wamp\www\smm.yasmalik.com\node_modules\svgo\lib\svgo\config.js:32:28)
at new module.exports (E:\wamp\www\smm.yasmalik.com\node_modules\svgo\lib\svgo.js:21:19)
at E:\wamp\www\smm.yasmalik.com\node_modules\postcss-svgo\dist\index.js:95:16
at Object.creator [as postcssSvgo] (E:\wamp\www\smm.yasmalik.com\node_modules\postcss-svgo\node_modules\postcss\lib\postcss.js:150:35)
at E:\wamp\www\smm.yasmalik.com\node_modules\cssnano\dist\index.js:295:40
at Array.forEach (<anonymous>)
at E:\wamp\www\smm.yasmalik.com\node_modules\cssnano\dist\index.js:282:29
at creator (E:\wamp\www\smm.yasmalik.com\node_modules\cssnano\node_modules\postcss\lib\postcss.js:150:35)
at processCss (E:\wamp\www\smm.yasmalik.com\node_modules\css-loader\lib\processCss.js:199:16)
It was issue with my node_modules folder. there were some extra useless packages so simply i just deleted node_modules and install it again with following commands
Step 1
Delete node_modules manually
Step 2
Install the node_modules folder again:
npm i
Step 3
Update existing packages
npm update
That's it!
Probably you have some conflicts with versions of some npm packages.
Try to reinstall npm:
rm -rf node_modules
npm install

Angular e2e testing without chromedriver

I am working on angular application e2e tests in very closed and secure environment, where it is not allowed to install chromedriver. It is Windows 7 with IE11 installed.
Command:
npm install chromedriver --save-dev
results with:
> chromedriver#2.31.0 install C:\_LocalWorkspace\Projects\SomeProject\node_modules\chromedriver
> node install.js
Downloading https://chromedriver.storage.googleapis.com/2.31/chromedriver_win32.zip
Saving to C:\Users\someuser\AppData\Local\Temp\chromedriver\chromedriver_win32.zip
ChromeDriver installation failed Error with http request: Error: connect ETIMEDOUT 172.217.21.208:443
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#^1.0.0 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN app#0.0.1 No repository field.
npm ERR! Windows_NT 6.1.7601
What are my options for e2e tests in this circumstances?
EDIT1:
The problem can be described in other words. The environment that I am working in is closed for direct binary downloading. I am working for a client that has such policy and I can not do anything about that. I am also not allowed to install chrome browser so I have to use internet explorer. Therefore, only available webdrivr is iedriver. ( Please correct me if I am wrong )
My main problem is to install all requirements to make protractor works. It is like I have no Internet connection, but just for binaries. Most of the npm dependencies can be installed normally.
Like:
npm instal webdriver-manager which works,
but
node ./node_modules/protractor/bin/webdriver-manager update fails to download these three files:
https://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.1.jar
https://chromedriver.storage.googleapis.com/2.26/chromedriver_win32.zip
https://github.com/mozilla/geckodriver/releases/download/v0.11.1/geckodriver-v0.11.1-win64.zip
I have an option (from the client) to download files in isolated environment let them through security check and then use them. I did that and I have placed those 3 files in SomeProject\node_modules\protractor\node_modules\webdriver-manager\selenium directory.
Then I have tried to run node ./node_modules/protractor/bin/webdriver-manager update again, hoping that it will skip the download and continue with the normal process steps, extracting etc. But it did not, again it failed to download with the same message.
Then I have extracted the zip files manually.
At this point I am not sure, does node ./node_modules/protractor/bin/webdriver-manager update need to do more things than downloading and extracting. Because it has terminated on download, and I did it manually but how can I know what it would do after if the download was successful?
Anyway, I tried npm run e2e command (which is starting my protractor tests) with extracted binaries in place.
The result was:
[13:24:07] I/local - Starting selenium standalone server...
[13:24:07] I/launcher - Running 1 instances of WebDriver
[13:24:11] I/local - Selenium standalone server started at http://53.150.192.128:58001/wd/hub
[13:24:11] E/launcher - The path to the driver executable must be set by the webdriver.ie.driver system property; for more information, see https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver. The latest version can be downloaded from http://sel
enium-release.storage.googleapis.com/index.html
From error message it is clear that I should download the latest version of iedriver from here as it is described here
I have chosen the latest version, currently 3.4
http://selenium-release.storage.googleapis.com/index.html?path=3.4/
that looks like this:
I took the first link IEDriverServer_Win32_3.4.0.zip downloaded it and extract it in SomeProject\node_modules\protractor\node_modules\webdriver-manager\selenium
But the problem with the same error message still exists. Am I placing it in correct target directory? Should I download maybe some other file from the image?
Please advise how can I install iedriever and run protractor tests.
EDIT2:
Also, the problem can be generalized and put like. How to install protractor dependencies by downloading them manually?

Resources