ionic-team / ionic-docs

Home Page:https://ionicframework.com/docs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bug: npm error when downloading code example from stackblitz

bb-face opened this issue · comments

Describe the Bug

In the documentation, in the code examples, there's a button to open a specific example in codeblitz. From there you can download the project and try it locally. When I do that (like the example of the moda: https://stackblitz.com/edit/angular-blqtjv?file=src%2Fapp%2Fapp.component.ts) and try to install it, I get the following error when running npm i:

❯ npm i
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: @angular/compiler-cli@11.0.9
npm ERR! Found: @angular/compiler@17.0.1
npm ERR! node_modules/@angular/compiler
npm ERR!   @angular/compiler@"17.0.1" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/compiler@"11.0.9" from @angular/compiler-cli@11.0.9
npm ERR! node_modules/@angular/compiler-cli
npm ERR!   dev @angular/compiler-cli@"~11.0.4" from the root project
npm ERR!   peer @angular/compiler-cli@"^11.0.0" from @angular-devkit/build-angular@0.1100.7
npm ERR!   node_modules/@angular-devkit/build-angular
npm ERR!     dev @angular-devkit/build-angular@"~0.1100.4" from the root project
npm ERR!   1 more (@ngtools/webpack)
npm ERR! 
npm ERR! Conflicting peer dependency: @angular/compiler@11.0.9
npm ERR! node_modules/@angular/compiler
npm ERR!   peer @angular/compiler@"11.0.9" from @angular/compiler-cli@11.0.9
npm ERR!   node_modules/@angular/compiler-cli
npm ERR!     dev @angular/compiler-cli@"~11.0.4" from the root project
npm ERR!     peer @angular/compiler-cli@"^11.0.0" from @angular-devkit/build-angular@0.1100.7
npm ERR!     node_modules/@angular-devkit/build-angular
npm ERR!       dev @angular-devkit/build-angular@"~0.1100.4" from the root project
npm ERR!     1 more (@ngtools/webpack)
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! 
npm ERR! For a full report see:

I'm using node version v20.10.0 and npm version 10.2.3

Expected Behavior

The expected bheaviour woudl be to be able to run npm i and set up the project locally.

Steps to Reproduce

  1. find a code example in the documentation;
  2. open the code in stackblitz;
  3. download the project;
  4. try to install it with npm i;

Screenshots

No response

Operating System

mac os

Browser

No response

Version

No response

Additional Information

No response