How to set cordova on my PATH for NetBeans Cordova project on a Mac?

北慕城南 提交于 2021-02-11 16:42:13

问题


Using Netbeans 7.4 RC2. I was using the last beta and everything worked like a charm, but after upgrading, I started getting this error:

Netbeans cannot find cordova or git on your PATH. Please install cordova and git.

I know it's just that my my PATH needs to include cordova, since that was never required pre-RC, but I cannot figure out HOW!!! The two examples I've run across are on Windows, but I am on a MacBook.

It's so aggravating that it's a one-line fix and I know nothing about how to fix it! Unless it is a NetBeans bug, but the Windows folks get it to work, so I assume I'm just naive.


回答1:


If you type in "ps" while at the UNIX prompt of the Terminal.app, you'll find out which shell you're running on.

In my case, I'm running "tcsh". Your path environment variable is found in your home directory: "~/.tcshrc".

In some cases you might have "bash", where the path environment variable might be set in ".bashrc", ".bash_profile, ".bash_login" or ".profile". More information can be found in this related question.




回答2:


What is your version of cordova? If you are using 3.1.0-X.X.X (not 3.0.X), that was released October 2, Cordova changed the version string returned on "cordova -v" command and NetBeans cannot handle it at the moment (because IDE consider it to be non-stable version of Cordova, like 3.0.0-rc1 and refuses to use it), thus saying "cordova not found".




回答3:


try to add /usr/local/bin to your path. In both .bash_profile and .profile. Also try to start netbeans from very same terminal, where both commands (git and cordova) works: $NETBEANS/bin/netbeans




回答4:


This issue is tracked here https://netbeans.org/bugzilla/show_bug.cgi?id=236792 Please add output of following commands to NetBeans bugzilla. which cordova cat ~/.bash_profile cat ~/.profile Thanks



来源:https://stackoverflow.com/questions/19173128/how-to-set-cordova-on-my-path-for-netbeans-cordova-project-on-a-mac

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