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

后端 未结 7 2311
悲哀的现实
悲哀的现实 2021-01-04 22:26

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

Phonegap got installed on the machine, but I am not able to use phonegap command.

相关标签:
7条回答
  • 2021-01-04 22:34

    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.

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

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

    So this is the path you need to add to the PATH variable under User variables on the Environment Variables.

    0 讨论(0)
  • 2021-01-04 22:38

    The Problem is you need to set 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 youruser:

    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 are copy pasting it wont work. Follow my previous answer to configure this. If you
    are not getting this set up let reply.

    0 讨论(0)
  • 2021-01-04 22:39

    Run CMD as Administrator seems to solve the problem.

    0 讨论(0)
  • 2021-01-04 22:42

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

    0 讨论(0)
  • 2021-01-04 22:45

    One reason may be you are running window command prompt instead of node.js command prompt. you can simply press window button and then search node.js,it will show you node.js command prompt, run it and then type phonegap command there to check whether the phone gap is properly installed or not.

    if you see something like this

    Usage: phonegap [options] [commands] Description: PhoneGap command-line tool. Commands: help [command] output usage information create create a phonegap project ...

    that means phonegap has installed successfully.. you can now execute any phonegap command

    0 讨论(0)
  • 2021-01-04 22:55

    Delete path variable from "users variable". That worked nicely for me.

    0 讨论(0)
提交回复
热议问题