Cannot switch to newer nodejs version

Few days ago I installed nodejs and npm using:

sudo pamac install nodejs npm

now npm is giving warnings since my node version is toooo old
So i wish to update my node version but pamac doesnt have newer versions.
So i used:

n lts

now i do have a newer node version installed but n isnt detecting the node installed through pamac and i cannot switch to the newer version of node installed by n as it still defaults to older version.

I tried uninstalling older node using pamac but it gets stuck in a dependency tree.

Here is how to work that out Node.js - ArchWiki
and Install & Manage Multiple Versions of Node.js with NVM on Linux

1 Like

the problem is with pamac and n not able to access each others installation of node.
involving nvm in this will further complex the issue as it cant access both pamac and n installation of node


1 Like

pamac requires sudo perms in my system

this has been the case since the starting

No. Pamac will ask for your sudo password if it needs it. It does not require it, always.

this still wont solve my problem

Don’t mess with the system node - apps installed with the package manager will depend on it.