-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Description
Current behavior
After scaffolding Angular 20 and then applying @cypress/schematic, Cypress has been entered into the package.json
file at the end of the devDependencies
key section with the literal version latest
:
"devDependencies": {
"@angular/build": "^20.2.1",
"@angular/cli": "^20.2.1",
"@angular/compiler-cli": "^20.2.0",
"@cypress/schematic": "^4.1.1",
"@types/jasmine": "~5.1.0",
"jasmine-core": "~5.9.0",
"karma": "~6.4.0",
"karma-chrome-launcher": "~3.2.0",
"karma-coverage": "~2.2.0",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.1.0",
"typescript": "~5.9.2",
"cypress": "latest"
}
Desired behavior
@cypress/schematic should retrieve and save the latest
version of Cypress in semver
format. For instance, at the moment, that would be 15.0.0
.
Test code to reproduce
Set up project with:
npm install -g @angular/cli@20
ng new angular-app --defaults=true
cd angular-app
this is available in https://github.com/MikeMcC399/cypress-test-tiny/tree/32388-angular-20/angular-app:
git clone --branch 32388-angular-20 https://github.com/MikeMcC399/cypress-test-tiny
cd cypress-test-tiny
cd angular-app
then execute:
ng add @cypress/schematic --e2e --component
cat package.json | grep cypress
Cypress Version
15.0.0
Node version
v22.19.0
LTS
Operating System
Ubuntu 24.04.3
LTS
Debug Logs
"cypress:open": "cypress open",
"cypress:run": "cypress run"
"@cypress/schematic": "^4.1.1",
"cypress": "latest"
Other
cypress/npm/cypress-schematic/src/schematics/utils/index.ts
Lines 29 to 33 in 58bee28
export function getLatestNodeVersion (packageName: string): Promise<NodePackage> { | |
const DEFAULT_VERSION = 'latest' | |
return new Promise((resolve) => { | |
return get(`http://registry.npmjs.org/${packageName}`, (res) => { |
attempts to pull version.latest
from http://registry.npmjs.org
GET
http://registry.npmjs.org/cypress produces the HTTP response 301 Moved Permanently
to https://registry.npmjs.org/cypress which is however using the https
protocol instead of http
.