https://cypress.io logo
Cypress run not waiting Cypress Install to finish ...
# i-need-help
a
I want to build a Dockerfile with Cypress installed, Below command is what i tried in Dockerfile
RUN npx cypress install && npx cypress run
In the logs below, the terminal seems not waiting for the cypress to finish install, and tries to run cypress directly causing error
Copy code
11:58:28  STEP 13/14: RUN npx cypress install && npx cypress run
11:58:28  Installing Cypress (version: 12.11.0)
11:58:28  
11:58:28  [STARTED] Task without title.
11:58:28  
11:58:28  > consulting-one-ui@ cy:run /opt/app-root/src
11:58:28  > cypress run
11:58:28  
11:58:28  No version of Cypress is installed in: /root/.cache/Cypress/12.11.0/Cypress
11:58:28  
11:58:28  Please reinstall Cypress by running: cypress install
11:58:28  
11:58:28  ----------
11:58:28  
11:58:28  Cypress executable not found at: /root/.cache/Cypress/12.11.0/Cypress/Cypress
11:58:28  
11:58:28  ----------
Suppose if i installed correctly in my local machine, it will have below log output
Copy code
$ npx cypress install --force

Cypress 12.11.0 is installed in C:\Users\random\AppData\Local\Cypress\Cache\12.11.0

Installing Cypress (version: 12.11.0)

āœ”  Downloaded Cypress
āœ”  Unzipped Cypress
āœ”  Finished Installation C:\Users\enhaong\AppData\Local\Cypress\Cache\12.11.0

You can now open Cypress by running: node_modules\.bin\cypress open

https://on.cypress.io/installing-cypress
e
I have something like this in my Dockerfile to point to the location
Copy code
# point Cypress at the /root/cache no matter what user account is used
# see https://on.cypress.io/caching
ENV CYPRESS_CACHE_FOLDER=/root/.cache/Cypress
RUN npm install -g "cypress@12.5.1"
RUN cypress verify
a
Hah, i dont have access to the root folder šŸ™‚
Actually im scratching my head that why the installation did not happen