Nx workspace: npm ERR! The Cypress App could not be downloaded.
Published in
2 min readSep 24, 2022
--
This error comes up when creating a new Angular workspace using the create-nx-workspace
command.
I was connected to an organization’s network, when I ran the command below:
npx create-nx-workspace@latest
This resulted in the error below
> NX Nx failed to create a workspace.
And the error log was something like below
npm ERR! Installing Cypress (version: 10.8.0)npm ERR!npm ERR! [STARTED] Task without title.npm ERR! The Cypress App could not be downloaded.npm ERR!npm ERR! Does your workplace require a proxy to be used to access the Internet? If so, you must configure the HTTP_PROXY environment variable before downloading Cypress. Read more: https://on.cypress.io/proxy-configurationnpm ERR!npm ERR! Otherwise, please check network connectivity and try again:npm ERR!npm ERR! ----------npm ERR!npm ERR! URL: https://download.cypress.io/desktop/10.8.0?platform=win32&arch=x64npm ERR! Error: self signed certificate in certificate chainnpm ERR!npm ERR! ----------npm ERR!npm ERR! Platform: win32-x64 (10.0.19044)npm ERR! Cypress Version: 10.8.0
Something about proxy configuration for Cypress.
I did not know the organization’s proxy server so I could not do the configuration for Cypress.
I found a solution on Stackoverflow.
Solution
- Used the URI from the error log to download Cypress
npm ERR! URL: https://download.cypress.io/desktop/10.8.0?platform=win32&arch=x64
- Set the Cypress binary variable to point to this installation. Note that I was in the workspace’s working directory when I ran the below command.
CYPRESS_INSTALL_BINARY=~/Downloads/cypress.zip npm install cypress — save-dev
This installed Cypress together with the missing dependencies that were missing for the workspace’s creation.
This resolved my specific issue.