android phonegap installation on command prompt —

2020-02-13 06:46发布

问题:

Am new to this PhoneGap application development when i tried to install phonegap with install (http://phonegap.com/install/) guide from command prompt this says me more error like

npm ERR! not found: git
npm ERR!
npm ERR! Failed using git.
npm ERR! This is most likely not a problem with npm itself.
npm ERR! Please check if you have git installed and in your PATH.

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nod
ejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "phonegap"
npm ERR! cwd C:\
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! code ENOGIT
npm ERR! Error: EPERM, open 'C:\npm-debug.log'
npm ERR!  { [Error: EPERM, open 'C:\npm-debug.log'] errno: 50, code: 'EPERM', pa
th: 'C:\\npm-debug.log' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nod
ejs\\node_modules\\npm\\bin\\npm-cli.js " "install" "-g" "phonegap"
npm ERR! cwd C:\
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! path C:\npm-debug.log
npm ERR! code EPERM
npm ERR! errno 50
npm ERR! stack Error: EPERM, open 'C:\npm-debug.log' npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\npm-debug.log
npm ERR! not ok code 0

Where as i install Git as well but why this error comes ? and is there any other way to install and work on phonegap ?

回答1:

Follow these steps :

  • Download and install Node.js. Following installation, you should be able to invoke node and npm on your command line.
  • Download and install a git client, if you don't already have one. Following installation, you should be able to invoke git on your command line.
  • Install the cordova module using npm utility of Node.js. The cordova module will automatically be downloaded by the npm utility.

On OS X and Linux: $ sudo npm install -g cordova

On Windows: C:\>npm install -g cordova

Source : PhoneGap Docs