I installed the latest node version 18.9.0 with brew. The I installed n with npm n. I can't switch the active version from 18.9.0 to 17.4.0 using n. I am not keen on using nvm, is there a way to do it with n?
I installed the latest version (18.9.0) first and then installed n globally and then now am trying to change the version with n, but I cannot seem to change the active version to a the lower one installed with n.
After installing n globally, I sudo n 17.4.0 but it does not change the active version.

The trace statements are showing that you have two copies of node installed. The one installed by
n(to/usr/local/bin/node) is later in yourPATH. The "active" version was installed by homebrew.You could uninstall the homebrew version, or modify your PATH.
(If you run
n doctorthis problem will be detected and explained.)