"phonegap" is not recognized as an internal or external command

I am trying to install phonegap 3.1 version using node.js command line interface.

The phone is installed on the phone, but I can not use the phonegap command. When I list the packages, I see the handset, but I can not run the command to create the project.

System configuration: OS: WIN XP, node version: 0.10.22, Version for npm: 1.3.14, phone version: 3.1.0,

EDIT:

Error message

C:> Phonegap

'phonegap' is not recognized as an internal or external command, operating program or batch file.

C:> npm -g call list

C: \ Documents and Settings \ vishal.kardode \ Application Data \ npm └── phonegap@3.1.0-0.15.0

+8
npm cordova
source share
7 answers

The problem is that you need to set the environment variable.

Start → Control Panel → System and Security → System → Environment Variables

or

Mycomputer → Right Click → properties → Advance System settings → Environment variables

under user variables for your user:

Path: %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT% \System32\WindowsPowerShell\v1.0\;C:\Users\user1\AppData\Roaming\npm\` Temp: %USERPROFILE%\AppData\Local\Temp 

If you copy it, it will not work. Follow my previous answer to configure this. If you do not receive this setting, let's answer.

+15
source share

There is a problem with the enthronement variable for the default path for your current user. Follow the steps.

  • Click "Start" and enter "regedit" in the search field. This will start the Windows registry editor program.
  • Type the following registry entry: HKEY_CURRENT_USER \ Software \ Microsoft \ Windows Script Host \ Settings
  • Select "Enabled" in the right window. If this entry exists, right-click and select Create, and then DWORD Value. Name the value "Enabled."
  • Right-click the Enabled entry and click Edit.
  • Change the number in the Value field to 1.. This will re-enable WSH.
  • close all open CMD windows and open a new window.
+6
source share

Running CMD as an administrator seems to solve the problem.

+3
source share

I got the same error, and adding the path to the environment variables did the trick.

Just pay attention to the correct path, because in my case it is different from the question.

See what you get when you do: npm -g list phonegap

In my case, it displays: c:\usr\local

So, this is the path to be added to the PATH variable in user variables of environment variables.

+2
source share

change the name from the phone saver to cordova You can use the following command to create a project through the cordova command line create hello com.example.hello HelloWorld

0
source share

Remove the path variable from "user variable". This worked well for me.

0
source share

One reason may be that you are running the Windows command prompt instead of the node.js. command prompt. you can just click the window button and then search for node.js, it will show you the command line of node.js, run it, and then enter the phonegap command to check if the gap in the phone is set correctly or not.

if you see something like this

Usage: phonegap [options] [commands] Description: PhoneGap command line tool. Commands: help [command] information about using output create create phone game project ...

which means that the telephone connection is successful. Now you can execute any phonegap command

0
source share

All Articles