run PhoneGap command using DOS - phonegap-plugins

I am learning phonegap.
After watching this video on youtube some videos
I realized that my CMD does not have a "cordova" and 'phoneGap' command.
I installed Phonegap for windows, but what can i do to run this command?
In the video the author use this command at '11.12'.

You have to configure your environment first.
There is a one-step installer PhoneGap installer for Windows:
http://docs.phonegap.com/getting-started/1-install-phonegap/desktop/
But if you intend to use the command-line (and you should) you have to take some previous steps:
install node and NPM
install and configure Git
install the Android SDK and the Java JDK
include all of that on your PATH environment variable
There is a full tutorial here:
https://cordova.apache.org/docs/en/6.x/guide/cli/index.html

Related

Perpetual NativeScript Mac Installation Issues

I could really use someone's help on this as I have been troubleshooting this for a really long time now with no remediation.
The issue is simply installing the NativeScript CLI onto my OSX Yosemite Mac. I followed the steps according to NS' website (installing proper Node.JS version, downloaded Xcode 7.2 (due to OS constraints), installed JSDK, installed NS Sidekick, installed Android Studio w/ proper SDK along with every other required dependancy.
However, when I run "sudo npm i -g nativescript --unsafe-perm" (otherwise it will throw a EACCES error), I get the following log with it saying I missing all of these dependencies I know I have but it is claiming I don't.
The biggest kick is that while it still will say NativeScript successfully installed, whenever I run any tns command (like tns doctor), the bash command cannot be found.
I have made sure to follow the directions of adding NS to my path as well as my Android and Java SDKs. Here is the full log:
jsmbp:~ Js$ sudo npm i -g nativescript --unsafe-perm
Password:
/Users/Jmsquillaro/.npm-packages/bin/nativescript -> /Users/Jmsquillaro/.npm-packages/lib/node_modules/nativescript/bin/tns
/Users/Jmsquillaro/.npm-packages/bin/tns -> /Users/Jmsquillaro/.npm-packages/lib/node_modules/nativescript/bin/tns
> fsevents#1.1.2 install /Users/Jmsquillaro/.npm-packages/lib/node_modules/nativescript/node_modules/fsevents
> node install
[fsevents] Success: "/Users/Jmsquillaro/.npm-packages/lib/node_modules/nativescript/node_modules/fsevents/lib/binding/Release/node-v48-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile
> nativescript#3.3.1 postinstall /Users/Jmsquillaro/.npm-packages/lib/node_modules/nativescript
> node postinstall.js
WARNING: adb from the Android SDK is not installed or is not configured properly.
For Android-related operations, the NativeScript CLI will use a built-in version of adb.
To avoid possible issues with the native Android emulator, Genymotion or connected
Android devices, verify that you have installed the latest Android SDK and
its dependencies as described in http://developer.android.com/sdk/index.html#Requirements
TIP: To avoid setting up the necessary environment variables, you can use the Homebrew package manager to install the Android SDK and its dependencies.
WARNING: The Android SDK is not installed or is not configured properly.
You will not be able to build your projects for Android and run them in the native emulator.
To be able to build for Android and run apps in the native emulator, verify that you have
installed the latest Android SDK and its dependencies as described in http://developer.android.com/sdk/index.html#Requirements
TIP: To avoid setting up the necessary environment variables, you can use the Homebrew package manager to install the Android SDK and its dependencies.
WARNING: CocoaPods is not installed or is not configured properly.
You will not be able to build your projects for iOS if they contain plugin with CocoaPod file.
To be able to build such projects, verify that you have installed CocoaPods.
The ANDROID_HOME environment variable is not set or it points to a non-existent directory. You will not be able to perform any build-related operations for Android.
To be able to perform Android build-related operations, set the ANDROID_HOME variable to point to the root of your Android SDK installation directory.
Cannot find a compatible Android SDK for compilation. To be able to build for Android, install Android SDK 22 or later.
Run $ sdkmanager to manage your Android SDK versions.
You need to have the Android SDK Build-tools installed on your system. You can install any version in the following range: '>=23 <=26'.
Run $ sdkmanager from your command-line to install required Android Build Tools. In case you already have them installed, make sure ANDROID_HOME environment variable is set correctly.
You need to have Android SDK 22 or later and the latest Android Support Repository installed on your system.
Run $ sdkmanager to manage the Android Support Repository. In case you already have it installed, make sure ANDROID_HOME environment variable is set correctly.
Error executing command 'javac'. Make sure you have installed The Java Development Kit (JDK) and set JAVA_HOME environment variable.
You will not be able to build your projects for Android.
To be able to build for Android, verify that you have installed The Java Development Kit (JDK) and configured it according to system requirements as
described in http://docs.nativescript.org/setup/ns-cli-setup/ns-setup-os-x.html#system-requirements
There seem to be issues with your configuration.
? Do you want to visit the official documentation? No
? Do you want to run the setup script? No
Your components are up-to-date:
nativescript,tns-core-modules,tns-android,tns-ios
Autocompletion is already enabled
Installation successful. You are good to go. Connect with us on http://twitter.com/NativeScript.
+ nativescript#3.3.1
added 692 packages in 156.18s
jsmbp:~ Js$ tns doctor
-bash: tns: command not found
What can I do to fix this? npm also declares "rollbackFailedOptional" every time I try to reinstall after I uninstall it. Is npm caching a broken version and can I force it to do a genuine "reinstall?" It has been so frustrating as everything looks messed up and I really don't want to give up on NS. Let me know your thoughts and thank you!
Begin by installing node.js correctly. I've you are having to you --unsafe-perm that means, the node.js installation is not done right.
I suggest you install nvm using homebrew and then install node from that. Please refer to my solution in this post https://discourse.nativescript.org/t/not-installing-on-macos/3292/4

Ionic setup issues on Windows 7

I am trying to install Ionic on Windows 7 machine.
First, installed NodeJS 6.1.0, It went fine
Then, ran npm install -g cordova, Went fine
Then, ran npm install -g ionic, Got error related to Python.
Installed Python 2.7
Again, ran npm install -g ionic, Got error related to Microsoft .Net
Framework 2 SDK.
Updated npm to 3.8.9, Still getting error related to Microsoft .Net
Framework 2 SDK.
Are Python and Microsoft .Net SDK actually required? Nowhere I could find about this in the installation guides.
no python and .net SDK are not required
you need to download Android SDK in the case of developing for android.
you can download android studio and download SDK from SDK MANAGER or simply download android SDK. In my case, I download the android studio and then used the SDk manager to download the SDK's.
You can download it from here Android SDK
Also ou need to have JAVA jdk installed on your system and you have to set
PATH for both android sdk , java and nodejs
add PATH in system variables to environment variable
to
C:\Program Files\nodejs\
C:\Users**SystemName**\AppData\Local\Android\android-sdk\tools
C:\Users**SystemName**\AppData\Local\Android\android-sdk\platform-tools
C:\Program Files\Java\jdk1.7.0_79\bin
the above paths are according to my system. The SystemName may differ on your system else will be the same.
You also need to set User Variable jsut above your system variable:
ANDROID_HOME : C:\Users\SystemName\AppData\Local\Android\android-sdk
JAVA_HOME : C:\Program Files\Java\jdk1.7.0_79
you may also need to install gradle using nodejs command
and add its user variable and system variable
like
GRADLE_HOME :C:\Program Files\gradle-2.9
same in system variable(i.e PATH)
But first of all you need to download Node.js
I tried v6.0.1 but it is not compatible for ionic 2 for now, so you can download v4.4.x or v5.x from Node js site(sorry dont have 10 repo poits to post the third link) for now and later use v6.0.x
now using nodejs command prompt you need to install npm http://blog.npmjs.org/post/85484771375/how-to-install-npm
after installing npm
install ionic 2 and cordova using
npm install -g ionic#beta cordova
now Ionic is installed on your system.
To start a new project
ionic start Myproject --v2
and if you want to start a ionic project using typescript
ionic start Myproject --v2 --ts
Now give command
cd Myproject
to go to the directory of your project
after that, to test your app use
ionic serve

How to manually install npm in Windows?

We may download .msi files from nodejs and install as normal windows application. This shall install both node.exe and npm in system.
In a development environment, I wish to install various version of node and npm in my machine.
I know how to download and install node.exe manually from nodejs. But I couldn't find a way to download npm for Windows manually and extract in the folder I want.
Per npm doc
You can download a zip file from https://github.com/npm/npm/releases, and unpack it in the node_modules\npm\ folder inside node's installation folder.
To upgrade to npm 2, follow the Windows upgrade instructions in the npm Troubleshooting Guide:
https://github.com/npm/npm/wiki/Troubleshooting#upgrading-on-windows
You can use Node Version Manager for windows to use different versions of node.js.
Also, you can use, NVMW,

install cordova failed with node.js command prompt

what is my problem? is it successfully installed or failed? It doesn't seem right for me.
Cordova was installed successfully. You are looking at the dependency tree, so don't worry.
Bear in mind that you have installed the CLI tools. You have to actually create a cordova project with the command before you will see a cordova project.
cordova create <Your project name>

Install Stylus manually in Node.js with Cygwin

after a few tries I successfully install nodejs in windows with cygwin...
And when I find out that I can't install npm in windows, I wonder...
How can I install the Stylus manually??
I downloaded the files from the Stylus Github Site
Where do I copy them??
What commands should I use in the cgywin to install it??
Not sure if this is too late, but good news everyone! NPM runs on windows without cygwin now :-)
http://npmjs.org/doc/README.html

Resources