Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error on installing angular/cli - not found: python2

I am trying to install with this command "npm install -g @angular/cli".

But I always get the error "Error: not found: python2"

Is there something I am missing here?

like image 384
jengfad Avatar asked Apr 25 '17 08:04

jengfad


People also ask

Why angular cli is not installing?

This means that NPM is corrupted in your system, and must reinstall NPM. This command takes a few minutes to complete as with this command your system will download the latest Angular/CLI package.

Is python required for angular cli?

Basically you'll need Python 2.7, make , and a C/C++ compiler (like GCC on unix, Xcode on OS X, or Visual Studio tools on Windows). To tell npm to use Python 2.7 (if you also have a different version installed), run npm config set python /path/to/executable/python2.


2 Answers

Just in case you do not want to downgrade, which is not needed anyways. Then this is what you should do,

  1. Fix node-sass version issue first: The issue is with the version of node-sass (prior to the python2 error). So install it as npm install node-sass.

  2. Now run npm install

  3. If it asks to fix using npm audit fix. Go ahead!

like image 166
Pankaj Bhagat Avatar answered Oct 31 '22 00:10

Pankaj Bhagat


Downgrade to npm version 4, try this:

npm install -g [email protected]

like image 45
pfrank Avatar answered Oct 30 '22 22:10

pfrank