I am on Ubuntu 22.04 and trying to install angular/cli globally. I am getting this warning:
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: 'pacote@15.0.6',
npm WARN EBADENGINE required: { node: '^14.17.0 || ^16.13.0 || >=18.0.0' },
npm WARN EBADENGINE current: { node: 'v12.22.9', npm: '8.10.0' }
npm WARN EBADENGINE }
I found multiple questions on stackoverflow regarding this problem. The answers all point at using a stable version of node. I have node version 18.12.1 which currently is the latest stable version and npm version 8.19.2 that comes with it.
Now I know that people will be asking in the comments if I have node version 18.12.1 installed, so here it is:
jan@ubuntu-22-04:~$ node -v
v18.12.1
jan@ubuntu-22-04:~$ npm -v
8.19.2
jan@ubuntu-22-04:~$
But then the warning seems to suggest that I have node version 12.22.9 and npm version 8.10.0.
npm WARN EBADENGINE current: { node: 'v12.22.9', npm: '8.10.0' }
So what is going on??? Is my understanding of the warning incorrect? Is there a Ubuntu-problem that I don´t understand? Can anybody please help me out?
EDIT:
It looks like I have two different versions of node. Look at this:
jan@ubuntu-22-04:~$ node -v
v18.12.1
jan@ubuntu-22-04:~$ sudo node -v
v12.22.9
jan@ubuntu-22-04:~$ npm -v
8.19.2
jan@ubuntu-22-04:~$ sudo npm -v
8.10.0
Using sudo gives me version 12.22.9 as the warning states. I still don´t know how to solve it. Can anybody help?