Slow response time for Ionic commands

Commands such as Ionic generate and Ionic build are slow to complete. A simple ionic build and ionic generate page are taking up to 5 minutes to complete. This started for me when I started to use a computer. The new computer is a Mac M1. Are there logs that I can view to see where the process is struggling?

Are you running ionic inside a virtual machine or docker container? How did you set up the build environment?

I have an M1 Pro and builds take under 30 seconds with a complex app, so it may be that you’re not using the arm64 version of something and that is severely slowing your builds down.

I am not running inside a virtual machine or docker container. I am doing what seems normal ionic development. I am currently working on two projects one small and one medium sized. When performing builds, created new pages using ionic generate, and ionic capacitor commands such as ionic capacitor copy, it takes much longer than expected. Same commands on MacBook execute as expected. Any ideas are appreciated. Thanks

How did you install your dependencies? If you used brew, are you sure it’s the arm64 version? It’s possible to install the x86 version on Apple Silicon, but this will give you terrible performance, so you want to make sure you have the arm64 one.

I do use brew for a few dependencies. I wasn’t aware of an install differences. After researching, I see that different install locations are used. For the M1 installs should be in opt/homebrew vs. usr/local/homebrew for intel. From this I believe that brew is installed correctly in the opt/homebrew folder. I could be missing easily be missing something. I appreciate your assistance, if something else comes to mind, please let me know.

Thanks

Hmm, it seems you have the correct homebrew installed then. If you enter which ionic in the terminal, what path do you get?

Basically, M1 should be super fast for ionic builds, at least as fast as any Intel Mac. So if you are getting slow performance, you probably have accidentally installed an x86 (intel) binary instead of an arm64 (Apple Silicon) one. This could easily have happened if you copied over all your data from an Intel Mac to an Apple Silicon Mac.

I get /.nvm/versions/node/v20.9.0/bin/ionic using which ionic. Does this give an indication of x86 vs. arm64? Thanks

That’s an NVM installation, and I don’t use NVM, so I can’t help you further. Hopefully somebody else has an idea or example of how to get it working.

What I can say is that it works pretty much out of the box if you use brew to install node and then install ionic globally with the brew-installed node.