cypress: Cypress stdout undefined in upzip.js in unziptool during installation
Current behavior:
Unzip.js fails
/mnt/c/Users/foob/node_modules/cypress/lib/tasks/unzip.js:130
sp.stdout.on('data', function (data) {
^
TypeError: Cannot read property 'on' of undefined
at unzipWithUnzipTool (/mnt/c/Users/foob/node_modules/cypress/lib/tasks/unzip.js:130:21)
Desired behavior:
Iād like this to be able to unzip.
Versions
OS: Windows 10 Running WSL Ubuntu 18.04 Node: 10.20.1 npm: 6.9.0 Cypress: 3.8.3
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 17 (2 by maintainers)
I was having the same issue on WSL2 with Ubuntu 18.04 LTS distro.
OS Details: Edition Windows 10 Pro Version 20H2 Installed on ā2/ā4/ā2021 OS build 19042.867 Experience Windows Feature Experience Pack 120.2212.551.0 Windows 10 Professional
The project currently uses Node v10.19.0.
When trying to install cypress 6.3.0 (defined in package.json, installed with npm install from root of source tree), I would see the same errors as reported above:
Looking at the cypress source for unzip.js, it appears to be spawning the system unzip command at unzip.js:102. If the unzip binary is not on the Ubuntu WSL2 distro system or in $PATH, unzipping will fail resulting in the error on unzip.js:130.
The solution for us to continue using Node v10 was to install the unzip apt package in Ubuntu 18.04 LTS WSL2 distribution (
apt install unzip)Upgrading Node to version greater than v12 also seems to work as previously reported, which does not require installing the unzip apt package.