When Setting up Cypress 'Configfile Is Invalid'

The error I get is:

Your configFile is invalid: /Users/mic/Desktop/Projects/MCAT/client/cypress.config.ts

I am simply trying to install cypress on to my project and am having this problem from the get go. I have tried delete and reinstalling package files. I've also tried manipulating tsconfig.json in multiple ways.

1

1 Answer

Reinstalling by itself will not help you, Cypress sees the old (invalid) config and does not generate the file on the second install.

You must remove the cypress.config.ts file, delete the cypress folder, then reinstall Cypress.

On opening, Cypress will then create a correct cypress.config.ts for you.

Make sure you also have installed typescript before you open Cypress, as it needs to recognize that you want to use typescript.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Maya Lin-Takahashi

Maya Lin-Takahashi

Consumer Tech & Gadget Reviewer

Maya is a hardware enthusiast who tests and reviews smart home devices, smartphones, wearables, and audio gear. She focuses on practical consumer value and build quality.

Share this article
Twitter Facebook Pinterest