Reputation: 1854
I have a Mac OS X version 10.9.1. I tried installing PhoneGap via the command line
$ sudo npm install -g phonegap
BUT i get the following error:
sudo: npm: command not found
Upvotes: 1
Views: 21360
Reputation: 1
you are getting this error because you do not have NODE packages installed in your machine. Download and install it before running npm install command from below link https://nodejs.org/en/download/
Upvotes: 0
Reputation: 171
If your npm isn't installed in /usr/local/bin, you must create a symbolic link for it first.
$ sudo ln -s $(which npm) /usr/local/bin/npm
$ sudo npm install -g phonegap
Upvotes: 1
Reputation: 1242
In one of the answers to the question suggesting chmod -R 777 - I must warn against using.
chmod -R 777 /usr/local/bin
This means that all files in bin and its subdirectories will be readable, writable and executable by the whole world.
If one did so by accident, as minimum change it to
chmod -R 755 /usr/local/bin
and then think closer about how the permissions should be set after that.
Upvotes: 0
Reputation: 2552
The phonegap is installed using the node package manager(NPM), the package is not available on your pc , so you need to install it.
use this command to install,
sudo apt-get install npm
It will fix the issue. then do the installation command .
Upvotes: 1
Reputation: 823
If u already install Node package and still getting the same error, then check the bin (/usr/local/bin) folder permission.
If you don't have enough permission then change folder the permission using below command.
sudo chmod -R 777 /usr/local/bin
I have shared my whole experience while installing the phone gap is here
https://sites.google.com/site/greateindiaclub/mobil-apps/ios/phonegapinstalltionwithnodejs
Upvotes: 0
Reputation: 263
You need to have the Node Package Manager installed on your system.
This requires you to install Node.js
Upvotes: 6