0

I am trying to install Azure CLi on my ubuntu 14.04 with command.

sudo npm install azure-cli -g

But it showing

sudo: npm: command not found


My npm configurations are.

npm version.

npm -v

3.10.5

which npm

/home/stack/.nvm/versions/node/v4.4.7/bin/npm

I don't know why it occurs.Please help me to solve this.

Gary Liu
  • 13,758
  • 1
  • 17
  • 32
  • 1
    Possible duplicate of [sudo: npm: command not found](http://stackoverflow.com/questions/31472755/sudo-npm-command-not-found) – pableiros Sep 05 '16 at 16:49

2 Answers2

0

The issue can be easily fixed by reinstalling Node js.

S A
  • 827
  • 10
  • 23
0

You cannot access to npm as sudoer, because of You have not installed nodejs, npm system-wide.

I don't see reason to use nvm.

Why not just install nodejs and npm as usualy.

sudo apt-get update
sudo apt-get install nodejs npm

Or compile from sources:

sudo apt-get update
sudo apt-get install make g++ gcc libssl-dev git
wget https://nodejs.org/dist/v4.5.0/node-v4.5.0.tar.gz
tar -zxf node-v4.5.0.tar.gz
cd node-v4.5.0
./configure
make
sudo make install
num8er
  • 18,604
  • 3
  • 43
  • 57