CLI Error With Angular Projects Only

Setup a new mac and installed Ionic. When running ionic start, I receive the following error. Will note that I am able to create a working version of every other type (Vue, React). Need some guidance on how to get this up and going ASAP as I have a client who has been waiting for me to get my new box up and going

npm i

npm ERR! code ERESOLVE

npm ERR! ERESOLVE unable to resolve dependency tree

npm ERR!

npm ERR! Found: postcss @ 8.2.14

npm ERR! node_modules/postcss

npm ERR! postcss @" 8.2.14 " from @angular-devkit/build-angular @ 0.1102.13

npm ERR! node_modules/@angular-devkit/build-angular

npm ERR! dev @angular-devkit/build-angular @" ~0.1102.4 " from the root project

npm ERR! peer @angular-devkit/build-angular @" ^0.1102.4 " from @ionic/angular-toolkit @ 3.1.1

npm ERR! node_modules/@ionic/angular-toolkit

npm ERR! dev @ionic/angular-toolkit @" ^3.1.1 " from the root project

npm ERR! peer postcss @" ^8.1.0 " from autoprefixer @ 10.2.4

npm ERR! node_modules/autoprefixer

npm ERR! autoprefixer @" 10.2.4 " from @angular-devkit/build-angular @ 0.1102.13

npm ERR! node_modules/@angular-devkit/build-angular

npm ERR! dev @angular-devkit/build-angular @" ~0.1102.4 " from the root project

npm ERR! 1 more (@ionic/angular-toolkit)

npm ERR! 9 more (css-loader, cssnano, postcss-import, postcss-loader, …)

npm ERR!

npm ERR! Could not resolve dependency:

npm ERR! peer postcss @" ^8.2.15 " from cssnano-preset-default @ 5.1.0

npm ERR! node_modules/cssnano/node_modules/cssnano-preset-default

npm ERR! cssnano-preset-default @" ^5.0.1 " from cssnano @ 5.0.2

npm ERR! node_modules/cssnano

npm ERR! cssnano @" 5.0.2 " from @angular-devkit/build-angular @ 0.1102.13

npm ERR! node_modules/@angular-devkit/build-angular

npm ERR! dev @angular-devkit/build-angular @" ~0.1102.4 " from the root project

npm ERR! 1 more (@ionic/angular-toolkit)

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/danieldugger/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:

npm ERR! /Users/danieldugger/.npm/_logs/2021-05-21T11_17_00_295Z-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.

1 Like

I am having this same issue.

Unable to start/install any new projects.

Same issue over here! I’ve tried reinstalling node and the same error kept appearing, kinda knew it wouldn’t have any effect probably but at least tried.

Try using nvm.

I’ve been having the same issue all morning. I’ve tried everything and I’m still getting those same errors.
Wonderful.

So is this an issue with a version of Node we are using? Will nvm give us any insights to which version of node is required to run the cli scripts?

No, but it will make it much easier to ensure that you have a clean node installation, and can switch between multiple installations without pain or root privileges.

As for versions, I recommend always using the latest LTS. I have seen chatter about problems with npm 7 - I would stick with npm 6.x for now.

I am using a brand new machine and used brew to install node. Strange that I can create every other project type.

Are you still having this issue? I am still experiencing it.

Yes, I am still having the issue

What’s your environment?

OS version
Node version
NPM version
Ionic version

Theres an issue with the ionic cli. Ive tried multiple times and getting same error. Capacitor does not install on fresh new project either. Im wondering if the cap 3 upgrade broke something…

This was my first thoughts, as well.

Ionic:

Ionic CLI : 6.16.1

Utility:

cordova-res : not installed globally
native-run : not installed globally

System:

NodeJS : v16.2.0
npm : 7.13.0
OS : macOS Big Sur

Whenever you have weirdness, always ensure it persists when using LTS NodeJS. As I write this, that is 14.17.0.

As I mentioned upthread, there are also many reports of trouble with npm 7. @mhartington commented on this recently.

Please see if your problems persist with LTS Node and npm 6.

1 Like

I did not realize that I had installed a version other than LTS. I appreciate your help and was able to get up and going. Might have to put you on retainer, lol.