npm error when I want to install @angular/cli

92 Views Asked by At

I want to install angular to Debian10, but I have got an error: enter image description here

Ok, I know the npm version is too old.

So I tried to install the latest npm with

npm install npm@latest -g

command, but I have got same error

I also tried to install npm form npmjs.com with

curl https://www.npmjs.com/install.sh

command (with switches -O -L) , but an XML file with NoSuchKey errorcode had been downloaded.

enter image description here

What do I wrong way? Do I need to run these commands as root or with sudo?
Thank you.

2

There are 2 best solutions below

1
tlvi38 On

Your npm version is probably fine. But your Node.js version is too old. Go to official node.js website and download a recent version.

You will find here the compatibles versions and for angular & node : https://angular.io/guide/versions

0
74hakansukur On

Problem is solved with upgrade Debian 10 to 11.