I was able to generate projects with “ionic start” in the past but now I’m getting ERESOLVE errors when trying to create a new Angular project. The only thing that may have changed on my system is npm / node which I update via Brew on my Mac laptop (Big Sur version).
My Node and NPM environments:
JoshTs-MacBook-Air:ionictmp josht$ npm --version 7.3.0 $ node --version v15.5.0 $ npm ls -g /usr/local/lib ├── @email@example.com ├── @firstname.lastname@example.org ├── @email@example.com ├── @firstname.lastname@example.org ├── @email@example.com ├── @firstname.lastname@example.org ├── email@example.com ├── firstname.lastname@example.org ├── ionic@ ├── email@example.com ├── firstname.lastname@example.org └── email@example.com $ npm ls josht@ /Users/josht ├── @firstname.lastname@example.org ├── @email@example.com ├── @firstname.lastname@example.org └── email@example.com JoshTs-MacBook-Air:ionictmp josht$ ionic --version 6.12.3 $ capacitor --version 2.4.5 $
When I “ionic start” with React or Vue things work fine and the project is created successfully.
When I try to “ionic start” any type of Angular project (besides my-first-app & conference) it fails with the following:
$ ionic start testproject blank --type angular ✔ Preparing directory ./testproject in 24.32ms ✔ Downloading and extracting blank starter in 419.27ms ? Integrate your new app with Capacitor to target native iOS and Android? No Installing dependencies may take several minutes. ────────────────────────────────────────────────────────────── Ionic Appflow, the mobile DevOps solution by Ionic Continuously build, deploy, and ship apps 🚀 Focus on building apps while we automate the rest 🎁 👉 https://ion.link/appflow 👈 ────────────────────────────────────────────────────────────── > npm i npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: firstname.lastname@example.org **npm ERR! Found: email@example.com** npm ERR! node_modules/typescript npm ERR! peer typescript@">=3.9 <4.1" from @firstname.lastname@example.org npm ERR! node_modules/@angular/compiler-cli npm ERR! peer @angular/compiler-cli@">=10.0.0-next.0 < 11" from @email@example.com npm ERR! node_modules/@angular-devkit/build-angular npm ERR! **npm ERR! Could not resolve dependency:** **npm ERR! peer typescript@">=3.9 < 3.10" from @firstname.lastname@example.org** **npm ERR! node_modules/@angular-devkit/build-angular** 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! See /Users/josht/.npm/eresolve-report.txt for a full report. npm ERR! A complete log of this run can be found in: npm ERR! /Users/josht/.npm/_logs/2020-12-24T21_12_48_169Z-debug.log [ERROR] An error occurred while running subprocess npm. npm i exited with exit code 1. Re-running this command with the --verbose flag may provide more information. $
In the package.json in the testproject directory I see in the DevDepenencies section:
Some things I tried:
- “npm update”
- npm cache clear --force
- The global version of typescript WAS 4.0.5 but I uninstall then re-install 3.9.5 but “npm i” still says it has found version 4.0.5
- Reboot (haha)
The question is this: Why does NPM think I have email@example.com installed when “npm ls -g” is showing version 3.9.5?
I’m not sure what else to try at this point. Things used to work. I could rip out all of node and NPM and re-install it but that seems like overkill. I could downgrade the global NPM Angular packages to 10.x but to be candid I don’t remember if they were always 11.x or if they were upgraded to 11.x as part of my troubleshooting.
I’ve worked with dependencies before but I"m baffled.
Any help would be much appreciated.