0

In an Angular project, ng add @cypress/schematic installs the latest version of Cypress by default. With the many breaking changes in Cypress 10 and a lack of documentation for implementing Cucumber in Cypress 10, this proves problematic. We want to use Cypress Schematic to install cypress@9.x.x. Using the regular npm install --save-dev cypress@9.x.x isn't desirable because it doesn't override commands like ng e2e like schematics does (instead, Protractor still controls those).

How can I force the ng add @cypress/schematic commmand to install a specific version of Cypress?

jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
Kyle Vassella
  • 2,296
  • 10
  • 32
  • 62
  • 1
    You can't, because then the configuration will also be wrong. You need to use a specific version _of the schematic_. – jonrsharpe Jun 11 '22 at 07:37
  • @jonrsharpe the problem is, even the old Schematics versions still set Cypress to install `latest` version in `package.json`. I guess I could change `package.json`'s `"cypress":"latest"` to my desired version and run an `npm install`? – Kyle Vassella Jun 11 '22 at 07:52
  • Yes, just run `ng add @cypress/schematic@` _then_ `npm install cypress@`. – jonrsharpe Jun 11 '22 at 07:53

0 Answers0