Feel free to close this issue if you fill like it's a duplicate of another one.
I wanted to update my angular project to the latest version and I executed the command:
ng update @angular/cli @angular/core
In my project I have as a development dependency @types/web (TypeScript DOM declaration files) because I have private libraries that use my applications and I like to make sure that all my projects use the same version of declaration files and also I like to decouple the TypeScript compiler version from the declaration files version.
The dependecy in the package.json looks like the following:
"@typescript/lib-dom": "npm:@types/web@^0.0.99"
You can see that the package hosted in NPM registry is @types/web but the name of the dependency store in node_modules is @typescript/lib-dom.
It's this way because TypeScript will search in /node_modules/@typescript/lib-dom to know if the declaration files have been installed independently. If the folder is not present, it will use the declaration files that come with the TypeScript compiler (/node_modules/typescript/lib/lib.dom.d.ts).
When I execute the ng update command, I get the following error:
✔ Packages successfully installed.
Using package manager: npm
Collecting installed dependencies...
Found 16 dependencies.
Fetching dependency metadata from registry...
✖ Migration failed: 404 Not Found - GET https://registry.npmjs.org/@typescript%2flib-dom - Not found
See ".../angular-errors.log" for further details.
Basically, the Angular CLI is trying to fetch @typescript/lib-dom but this is not the name of the package, the correct name to fetch is @types/web.
Minimal Reproduction
I have created the following repository that reproduces the issue.
You don't need to clone it, you can follow the steps explained in the README.md:
[error] HttpErrorGeneral: 404 Not Found - GET https://registry.npmjs.org/@typescript%2flib-dom - Not found
at /tmp/angular-cli-packages-Fv6UlW/node_modules/npm-registry-fetch/lib/check-response.js:95:15
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async RegistryFetcher.packument (/tmp/angular-cli-packages-Fv6UlW/node_modules/pacote/lib/registry.js:87:19)
at async Promise.all (index 3)
at async /tmp/angular-cli-packages-Fv6UlW/node_modules/@angular/cli/src/commands/update/schematic/index.js:671:36
at async callRuleAsync (/tmp/angular-cli-packages-Fv6UlW/node_modules/@angular-devkit/schematics/src/rules/call.js:77:18)
Command
update
Is this a regression?
The previous version in which this bug was not present was
No response
Description
I searched through the issues and I did found some related issues but they weren't exactly the same:
Feel free to close this issue if you fill like it's a duplicate of another one.
I wanted to update my angular project to the latest version and I executed the command:
In my project I have as a development dependency
@types/web
(TypeScript DOM declaration files) because I have private libraries that use my applications and I like to make sure that all my projects use the same version of declaration files and also I like to decouple the TypeScript compiler version from the declaration files version.The dependecy in the
package.json
looks like the following:You can see that the package hosted in NPM registry is
@types/web
but the name of the dependency store innode_modules
is@typescript/lib-dom
.It's this way because TypeScript will search in
/node_modules/@typescript/lib-dom
to know if the declaration files have been installed independently. If the folder is not present, it will use the declaration files that come with the TypeScript compiler (/node_modules/typescript/lib/lib.dom.d.ts
).When I execute the
ng update
command, I get the following error:Basically, the Angular CLI is trying to fetch
@typescript/lib-dom
but this is not the name of the package, the correct name to fetch is@types/web
.Minimal Reproduction
I have created the following repository that reproduces the issue.
You don't need to clone it, you can follow the steps explained in the
README.md
:https://github.com/jordimarimon/angular-cli-update-issue
Exception or Error
Your Environment
Anything else relevant?
No response