Bird
0
0

You want to install Cypress only for your current project and ensure it is not included in the production build. Which command should you use?

hard📝 Application Q8 of 15
Cypress - Basics and Setup
You want to install Cypress only for your current project and ensure it is not included in the production build. Which command should you use?
Anpm install cypress --global
Bnpm install cypress --save-prod
Cnpm install cypress
Dnpm install cypress --save-dev
Step-by-Step Solution
Solution:
  1. Step 1: Understand devDependencies vs dependencies

    Packages installed with --save-dev go into devDependencies and are excluded from production builds.
  2. Step 2: Choose correct command

    npm install cypress --save-dev installs Cypress only for development, not production.
  3. Final Answer:

    npm install cypress --save-dev -> Option D
  4. Quick Check:

    --save-dev = development only, excluded from production [OK]
Quick Trick: Use --save-dev to exclude package from production build [OK]
Common Mistakes:
  • Using --save-prod which is invalid
  • Installing globally instead of locally
  • Installing without flags includes in production

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Cypress Quizzes