Component test pnpm scaffolding uses pnpm install
not add
#29052
Labels
pkg/launchpad
This is due to an issue in the packages/launchpad directory
type: user experience
Improvements needed for UX
Current behavior
When scaffolding Cypress Component Testing in the presence of a
pnpm-lock.yaml
file from the pnpm package manager Cypress outputs a command string to instruct the user to install dependencies which starts withpnpm install
. For instance, if "Vue CLI (Vue 3)" is selected as a front-end framework, the suggested installation command is:Desired behavior
Cypress Component Testing scaffolding for pnpm environments should prepend the following command to the framework modules to be installed:
instead of
pnpm install -D
.Although
pnpm install
appears to install the dependencies listed, it is not the documented way to do this ("pnpm install
is used to install all dependencies for a project."). The description forpnpm add <pkg>
says "Installs a package and any packages that it depends on. By default, any new package is installed as a production dependency.".Cypress should not rely on an undocumented method to add packages using pnpm.
pnpm install
is undocumented for this purpose, whereaspnpm add
is documented as the method to add packages.Test code to reproduce
In a terminal window, execute:
npm install pnpm@latest -g mkdir cy-pnpm-ct cd cy-pnpm-ct git init pnpm init pnpm add cypress -D pnpm cypress open
Select "Component Testing"
Select "Front-end framework" > "Vue CLI (Vue 3)"
Click "Next step"
Note the instruction
Paste the instruction into a separate terminal window and execute it.
Note that it runs successfully.
Cypress Version
13.6.6
Node version
v20.11.1
Package manager and version
pnpm
8.15.4
Operating System
Ubuntu
22.04.4
LTSDebug Logs
Other
References
pnpm install
pnpm add <pkg>
The text was updated successfully, but these errors were encountered: