Netbeans Cannot Find Cordova or Git on your path

不羁岁月 提交于 2021-01-21 08:18:42

问题


I just install the latest netbeans 7.4 RC1 , i got the Error page "Netbeans Cannot Find Cordova or Git on your path, Please install Cordova or Git". In fact, i actually did install both cordova and Git.

I Do follow the step on this youtube ,

https://www.youtube.com/watch?v=Gt4uHSiO-00

but it is still not allow me to open any HTML 5 cordova project.

Is that any steps i left out ?


回答1:


I had the exact same problem. I found this bug: https://netbeans.org/bugzilla/show_bug.cgi?id=234870

Go to the command prompt. Try typing:

git --version    
cordova --version

If you get a "command not found" error, you have an issue with your installation. More than likely you need the items added to your path variable. In my case, that was C:\Users\Chris\AppData\Local\GitHub\PortableGit_015aa71ef18c047ce8509ffb2f9e4bb0e3e73f13\bin;C:\Users\Chris\AppData\Roaming\npm

for both Cordova and Git.




回答2:


I think the error message logic is broken, that's why this is misleading. In my case, git wasn't in the PATH, but cordova was. Making sure git was added to the PATH, fixed this.




回答3:


Had the same exact problem, looking here https://netbeans.org/bugzilla/show_bug.cgi?id=234870 this answer solved my problem:

On Windows, NetBeans tries to run "cordova.cmd -v" to check if Cordova is ready. So I modified this cordova.cmd file to simply return fake version:

@echo 3.0.1

this allows me to get through the wizard step, where is being checked if Cordova is installed. After that, I revert changes in cordova.cmd and finished new project wizard. And it worked and I can even build and start it on Android device. This "workaround" works until I close IDE. So the problem is only at the beginning in checking if Cordova is installed

On command line run

where cordova

to get where it is located (usually in C:\Users\\AppData\Roaming\npm)




回答4:


You have to use cordova version 3.0.10 instead of 3.1 Netbeans does not seem to work with Cordova 3.1

type in

npm install -g cordova@3.0.10

and restart Netbeans.




回答5:


Be sure to check if you have any enclosures in your environment variables. I made this mistake and it gave me a lot of headache :)

Not okay: "C:\Program Files\nodejs\";C:\Program Files (x86)\Git\bin

Okay: C:\Program Files\nodejs\;C:\Program Files (x86)\Git\bin




回答6:


If you install Netbeans 8 on Ubuntu 14.04, you should type

sudo ln -s /usr/bin/nodejs /usr/bin/node

then follow http://cordova.apache.org/docs/en/edge/guide_cli_index.md.html#The%20Command-line%20Interface




回答7:


I had the almost the same problem using NetBeans 8.1 on Windows 7. Except NetBeans said Cordova (only) cannot be found on my PATH but Cordova was installed and on the PATH. So like everyone suggested, I tested the versions.

C:\>git --version
git version 2.7.0.windows.2

C:\>cordova --version
? May Cordova anonymously report usage statistics to improve the tool over time? No

You have been opted out of telemetry. To change this, run: cordova telemetry on.
6.2.0

Strange, the --version asked for user input which I gave. I reopened Netbeans to find it can now magically see the install of cordova. Come to find out my whole problem was that Netbeans couldn't see it installed because Cordova was forcing user input the first time cordova --version was ran. Cordova had been freshly installed and never ran.




回答8:


If anyone is using Netbeans 8.0, this is the tutorial you need to follow provided on the website of Netbeans: https://netbeans.org/kb/docs/webclient/cordova-gettingstarted.html

Happy coding with cordova...!!!




回答9:


I solved this problem with installing GIT from this link :

http://git-scm.com/book/en/Getting-Started-First-Time-Git-Setup

hope this help someone.




回答10:


I had the same problem. I found the one solution on another site.
Try this: re-install git and choose the option *Use Git and optional Unix tools from the windows Command Prompt.




回答11:


  1. Just follow the installation process as describe in phonegap(cordova) documentation but make sure when you are installing git you checked the option use git and optional Unix tools from the windows command prompt after that go to path variable check that C:\Program Files\nodejs\;C:\Program Files (x86)\Git\bin exists in your path environment variable as shrty has said. You can test if node.js is install by node --version and git by git --version

  2. Get the path where npm install -g cordova installed your
    cordova. It produces something like "} (current: {"node":"0.10.36","npm":"1.4.28"}) C:\Users\kanu\AppData\Roaming\npm\cordova ->: if you go in

C:\Users\kanu\AppData\Roaming\npm\ directory you'll find cordova.exe there What you have to do is to add ;C:\Users\magezi\AppData\Roaming\npm\ in environment after the git's one.

After that change the directory to where cordova.exe exists for me it was in C:\Users\kanu\AppData\Roaming\npm\ and from there you can test the installation of cordova by the command cordova --version(it will return the version)

open netbeans and try to create an cordova application. It should work




回答12:


I had the same issue under linux, and was tinkering around with the user specific $PATH. What solved it eventually was to set the $PATH variable in the netbeans.conf located at $NETBEANS_PATH/etc/netbeans.conf

I added these three lines

export ANDROID_HOME=/home/paul/Android/Sdk
PATH="$PATH:/home/paul/opt/node-v4.4.7-linux-x64/bin/:/home/paul/Android/Sdk/tools"
export PATH

Afterwards I was finally able to setup any Cordova project :)



来源:https://stackoverflow.com/questions/19074743/netbeans-cannot-find-cordova-or-git-on-your-path

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!