Can't find Git or Cordova on your path (Windows/Netbeans), Can't find GitHub under AppData/Local, FIX 2015 - node.js

Error: NetBeans cannot find git or cordova on your path.
When trying to create a new Cordova Application in Netbeans.
How to fix? > THE ANSWER CAN BE FOUND BELOW :)

If anyone wants to know how to get Cordova working in Netbeans anno 2015/2016 here is the fix:
I have installed:
Git version: 2.5.1 for Windows 64 bit
Cordova version: 4.3.1 for Windows 64 bit
Node.js version: 0.12.0 for Windows 64 bit
Netbeans version: 8.0.2 x86
In Netbeans when I start a new project and select HTML5>Cordova Application then I will get this error:NetBeans cannot find git or cordova on your path.
After some searching on the good old internet, I found some pieces of information hither and thither which was correct but which didn't solve my problem. The reason for this was that it was old or slightly different than my problem. So I did the following to fix this problem:
I checked where my Cordova/npm files where and I happily found them in: C:\Users\\AppData\Roaming\npm
Next I had to find my Git.exe which FOR ME is located in: C:\Program Files\Git\bin (FOR SOME PEOPLE IT CAN BE FOUND IN: C:\Users\\AppData\Local\GitHub\PortableGit_)
Now I found out that Netbeans is using the windows PATH VARIABLES to locate git and cordova. For those who don't where to find or set the system Path Variables this website will help you find or set it: https://java.com/en/download/help/path.xml
I use windows 7 so I did this to change my path variables:"
-Select Computer from the Start menu
-Choose System Properties from the context menu
-Click Advanced system settings > Advanced tab
-Click on Environment Variables, under System Variables, find PATH, and click on it.
-In the Edit windows, modify PATH by adding the location of the class to the value for PATH. If you do not have the item PATH, you may select to add a new variable and add PATH as the name and the location of the class as the value.
SO edit path and then you see like C:/apath;C:/asdas; < enter here your git path;<enter here your cordova path and save it by clicking the OK button.
Restart Netbeans and now it has to work.
:)

For those getting here and the solution from #bboni did not work - as it did for me:
Make sure everything is installed correctly by opening a command prompt (open start-menu and type cmd).
Type the following commands git --version, cordova -v and node -v.
For me it looked like this:
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. Alle Rechte vorbehalten.
C:\Users\JohnDoe>git --version
git version 2.8.4.windows.1
C:\Users\JohnDoe>cordova -v
6.2.0
C:\Users\JohnDoe>node -v
v4.4.5
That makes sure everything is installed correctly. If one or more commands result in an error, then it's either not installed or not added to PATH as described by #bboni.
Now open your Netbeans and go to Tools → Options → HTML/JS → Mobile Platforms and check if you can see somethink like Installed Cordova version: 6.2.0. This is to make sure Netbeans is basically able to detect Cordova.
At that point all the tutorials I found online ended. I came up with the idea to check if Netbeans' own Terminal would be able to execute the command above as well: Tools → Open in Terminal
I got an error telling me I'd need Cygwin to use the Terminal. So I installed it, restarted Netbeans, opened the Terminal, checked the commands above and they worked.
I checked Configure Cordova again - the error was gone and I could finally ran my app directly from Netbeans as I wanted to.   :)

Related

Changing CAPACITOR_ANDROID_STUDIO_PATH in Arch Linux

I'm trying to set up my development environment for CapacitorJS on Arch Linux.
I followed the documentation and added
CAPACITOR_ANDROID_STUDIO_PATH=/usr/bin/android-studio
to my systems environment variables (not the project) but I'm still getting the same error
[error] Unable to launch Android Studio. Is it installed?
Attempted to open Android Studio at:
/usr/local/android-studio/bin/studio.sh
You can configure this with the CAPACITOR_ANDROID_STUDIO_PATH
environment variable.
Even though It's never pointed to /usr/local/android-studio/bin/studio.sh
I ran whereis android-studio and got android-studio: /usr/bin/android-studio, so I thought that would be the correct path, but every time I run npx cap open android it says it's trying it launch from the same path and never changes
It depends how you've installed it, for example Toolbox installs it inside the user's home directory.
nano ~/.bashrc
export CAPACITOR_ANDROID_STUDIO_PATH=~/.local/share/JetBrains/Toolbox/apps/AndroidStudio/ch-0/202.7486908/bin/studio.sh
locate studio.sh might be able to find it, too.

NPM not recognised in WebStorm and unable to go back to past commands

I am using a mac and currently have node and npm installed. This works fine if I use the normal terminal. But it is not recognised in my Webstorm (using Ultimate version) terminal. Getting following output:
$ node
/bin/ksh: node: not found
$ npm
/bin/ksh: npm: not found
$
Also if I try to click up to go back to past commands, it doesn't work either. I end up with following output:
^[[A
If I try with others such as Java, it works fine as follows:
$ java -version
java version "1.8.0_162"
Java(TM) SE Runtime Environment (build 1.8.0_162-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.162-b12, mixed mode)
Noticed that Webstorm is definitely picking up my node path considering it is visible when I try to create a new project as shown in following image:
What am I doing wrong? I have seen setups in colleagues laptops and they do not have node/npm set up in bash_profile but everything still works. Could I get some help with this please. Thanks.
It's to do with the choice of your shell. looks like you have chosen to use ksh. Switch it back to something like bash.
I would suggest to do this gobally so that you don't have to keep doing this every time you open a new project.
Thus close your project, click Configure on bottom left and choose Preferences.
Select Tools -> Terminal
Under Application Settings, change your Shell path to /bin/bash (it should be /bin/ksh currently).
Apply and ok. Open your project and try to perform above actions which should work now.

Vs2013 Nodejs project.. 2nd box..."specified executable is not a valid applications for this OS platfrom

I have a nodejs project in Vs2013
I built it on a w7, 64 bit machine, and it's working, on my main box, check it into TFS and it builds and runs test in Team city. Also runs from a batch file that calls protractor.cmd directly.
I pulled it down on a second box, windows 7, 64 bit
installed Java jdk, VS Node tools, node.js, protractor, VS2013 update 4.
If I run it from the batch file it runs fine. If a debug the project in vs2013 it crashes with the error above
The specified executable is not a valid application for this OS platform.
There are some SO questions that says node.exe is the problem but I searched my drive (with agent ransack) and can't find node.exe anywhere.
I uninstalled the 64 JDK and installed the 32 bit JDK and no joy..
I'm assuming I've installed the wrong version of something.. but I don't know what
Any Ideas? Any Help Is appreciated.
Make sure you added Node.exe to the path.
You said you installed nodejs, so look for Node.exe in something like C:\Program Files\nodejs\
If you can't find Node.exe, then uninstall nodejs and reinstall it and pay attention to where it installs.
Now that you have Node.exe, add it to the path by
right click on My Computer
select Properties
activate the Advanced tab
click the Environment Variables button
edit the Path system variable

Did I break phonegap when adjusting environment variables on Windows 7?

Installed node.js
Installed phonegap: npm install -g phonegap
Created the example app: phonegap create hello com.example.hello HelloWorld
Used the run command to test in Android: phonegap run android
What happened next is it didn't detect the Android SDK, so it asked me for build.phonegap.com account. I went ahead and created an account and entered user/pw and like magic, it created the app in the cloud. I pointed my qr code scanner to the screen and it installed on my Android phone. Cool, but...
I wanted to develop locally using the Android emulator. So I followed the instructions (http://docs.phonegap.com/en/3.0.0/guide_platforms_android_index.md.html#Android%20Platform%20Guide) to install Android SDK, change PATH variables, etc.
When I went back to command line and cd to my phonegap root folder, suddenly "'phonegap' is not recognized as an internal or external command...'. I tried to reinstall phonegap with npm and it looks like it installs just fine again, but even when restarting cmd.exe, phonegap commands do not work.
Any ideas? Changing environment variables shouldn't affect phonegap already installed, right? The only other thing I can think is I had to install Ant and made an ANT_HOME system variable..
Apologies for the noob question. I'm sure I'm just messed up something simple here..
Figured this out. I accidentally DELETED the environment variables for node.js when I was trying to APPEND additional environment variables manually for android sdk & Ant. Since phonegap was installed as a node package, it wasn't recognized.
Better reinstall using the Msysgit and give the correct path. In my case envi variable path is as follows,
C:\Program Files\nodejs\; ->NodeJS path
F:\windows_adt\sdk\platform-tools; ->SDK Platform Tools
F:\windows_adt\sdk\tools; ->SDK Tools
C:\msysgit\bin; ->Bin Folder
C:\msysgit\git; ->git
C:\msysgit\libexec\git-core; ->git-core, if you want.
To reduce further errors use the recommended msysgit shell.

Node JS ./configure + make fails unable to remap python lib-dynload/itertools.dll to same address as parent

This might be more of a CYGWIN question than a Nodejs but here goes.
I installed Cygwin yesterday and on the packages selection I just clicked next as it looked like most were pre-selected, and then today read this guide http://boxysystems.com/index.php/step-by-step-instructions-to-install-nodejs-on-windows/ on installing nodejs.
The ./configure had an error that it was unable to remap python lib-dynload/itertools.dll to same address as parent. As the process still completed I tried the make command, but it fails on the same error.
So, I opened cygwin setup.exe and this time I clicked the source checkbox for all the Python packages. But still get the same error. Should I now go to Cygwin and check all the source packages for the Make packages, delete it and reinstall from scratch using the above guide. Or something else?
Any help gratefull received/
Use the official 0.5.x windows build from http://nodejs.org/#download - you just have to download a .exe file and you can start it.
Versions 0.5.X have problems with Cygwin and because of developing clean Windows version Cygwin environment is now unsupported. Stable version 0.4.12 builds on Cygwin with no problems. If you want to use node.js unstable 0.5.X branch on Windows use windows build at official node.js site.
check this out:
https://github.com/joyent/node/wiki/Building-node.js-on-Cygwin-(Windows)
Update Sept 1, 2011 -- as of today, v0.5.5 does not build on Cygwin (errors on make). Use v.0.5.4 (ie. follow instructions below and use "git checkout v0.5.4".
https://github.com/joyent/node/wiki/API-changes-between-v0.4-and-v0.6
Cygwin build is no longer supported. Use native windows builds instead.

Resources