Install NPM on linux

2020-06-23 05:29发布

问题:

My purpose is to install angularjs !

For that i need => npm,so I want to install nodejs for having "NPM" but i have this error :

File "./configure", line 16, in <module>
from gyp.common import GetFlavor
File "./tools/gyp/pylib/gyp/__init__.py", line 8, in <module>
import gyp.input
File "./tools/gyp/pylib/gyp/input.py", line 873
except ImportError as e:

Probably the problem is the version of python 2.5 : The problem is i don't have right to update python.

PLZ, how can i install npm on linux without Nodejs

Helps appreciated.

Regards

回答1:

First update your system's package and make sure you have newest versions of packages and their dependencies.

sudo apt-get update

Then install npm(and/or nodejs if needed)

sudo apt-get install npm nodejs 

Finally, you may install angular with following command

npm install angular

FYI, The best way to install npm is to install node using the node.js installer. npm is installed as part of node.