I am trying to change the version of nodejs using cmd n installed globally by yarn. Neither yarn is detected by sudo nor n.
Please help me to fix this:
When running the n command to change node version, it shows permission is denied by many files to be written by n

Two approaches to avoid permission issues without requiring use of sudo when running
n:N_PREFIXandPATH(see alson-installwhich automates this)/usr/localSee the project README for more: https://github.com/tj/n
(Disclaimer: I am the maintainer of
n.)