Software Archive
Read-only legacy content
17061 Discussions

Cordova CLI error

Alex_Hang
New Contributor II
2,694 Views

Hello, now that the intel xdk cloud system is deprecated, I am trying to switch to Cordova CLI, but I have a problem.

Every time I try to build the app I have an error saying that npm is not recognized.

I even tried to create a basic Hello World app, using

cordova create hello_world
cordova platform add android

The first command runs well, but the second one gives me this error

Untitled.png

I have the same error when I try to create a project using PhoneGap, I even run PostInstall.bat, but it still does't work.

Do I have to install anything else, can you please help me?

0 Kudos
12 Replies
PaulF_IntelCorp
Employee
2,694 Views

Alex -- what happens if you type "npm --version" at the command prompt? If nothing, you either do not have npm installed or it is missing from your path. If you do see a response, then there is something goofy about your Node.js or Cordova CLI install.

0 Kudos
Alex_Hang
New Contributor II
2,694 Views

I typed npm version, and it seems i have it installed ( I attached the screenshot)

I think there is a problem with Cordova CLI, but what about PhoneGap Desktop App? Isn't this weird? Both have the same error, but npm is installed corectly......

0 Kudos
Hamilton_Tenório_da_
Valued Contributor I
2,694 Views

Alex,

Maybe the configuration. I followed some tutorials and it is working for me: https://www.youtube.com/watch?v=dmDRZx-2xJE

Try it.

Hamilton

0 Kudos
Alex_Hang
New Contributor II
2,694 Views
Thank you very much sir, I will follow those tutorials and try to make it work. Untill then I hope I will still be able to start a project using Intel XDK, the building system works with PhoneGap Build, but not on my PC with Cordova CLI.... this is weird...
0 Kudos
Hamilton_Tenório_da_
Valued Contributor I
2,694 Views

Alex,

Great. Good luck.

For me, after some time searching and testing, I am able to build and publish normally without XDK.

I do not build with Cordova. Cordova I use to prepare everything, but I build with Android Studio and XCode.

You will need a Mac (or Virtual Machine with MacOS) to build for iOS.

Hamilton

0 Kudos
Alex_Hang
New Contributor II
2,694 Views
I know that it's pretty difficult to build for IOS, you need a lot of certificates, XDK was making this very easy, but, too bad they decided to retire it......
0 Kudos
Hamilton_Tenório_da_
Valued Contributor I
2,694 Views

The worst part is understand the Apple concepts. After this initial pain (for me it was a big pain), it is pretty easy. XCode can include/generate all certificates for each app. And, after build, just one click to send to Apple Store. Don´t be affraid. 

0 Kudos
Alex_Hang
New Contributor II
2,694 Views
I found a few alternatives to XDK, such as Ionic or Monaca, but they are not even close to it (and they only allow you to build a limited number of apps)
0 Kudos
PaulF_IntelCorp
Employee
2,694 Views

Alex Hang wrote:

I typed npm version, and it seems i have it installed ( I attached the screenshot)

I think there is a problem with Cordova CLI, but what about PhoneGap Desktop App? Isn't this weird? Both have the same error, but npm is installed corectly......

The "PhoneGap Desktop App" is built on top of PhoneGap CLI, which is built on top of Cordova CLI. In essence, PhoneGap CLI is Cordova CLI with a special "redirector" that performs your builds with PhoneGap Build if you do not have the right tools to perform the build locally.

Here's an example of how it works:

  • Assume you are on a Windows machine and have Visual Studio and Android Studio installed.
  • Obviously, you can build locally for Windows and Android, but not for iOS.

then:

  • Build for Android >> results in running Cordova CLI under the hood, on your machine
    --which uses your local Android build tools to actually perform the build
  • Build for Windows >> results in running Cordova CLI under the hood, on your machine
    --using your local Visual Studio tools to perform the actual build
  • Build for iOS >> results in sending your project to PhoneGap Build
    --where it is built remotely on a Mac using Xcode on that Mac and returned to you

There are ways to force all builds to happen remotely, using PhoneGap Build, but the default is to build locally unless you do not have the build tools. Likewise, PhoneGap Build uses standard Cordova CLI, on a server, with a few enhancements to deal with cloud-based builds (such as being able to specify the CLI version number) and with a few limitations (such as not supporting gradle scripts and hooks scripts in plugins, for security reasons). These limitations are similar to what you have with the Intel XDK cloud-based build system.

Hope this helps to clarify.

0 Kudos
Alex_Hang
New Contributor II
2,694 Views
Thank you for those details sir, I have a question: The Intel XDK will be available for creating the projects and the packages or these two features will also be retired (I saw a post on StackOverflow saying that XDK will be retired in July) As far as I know only the build servers will be retired, the package creator will remain, right ? Thank you, Alex Hang
0 Kudos
PaulF_IntelCorp
Employee
2,694 Views

That's correct, the build system will be retired. The rest of the XDK, as you see it today, will continue to be usable after the build system has been retired. The build tiles will disappear when the build system is retired, but the "Cordova Build Package" tool that allows you to export a project for use with PhoneGap Build or Cordova CLI will still work (it does not rely on the backend).

0 Kudos
Alex_Hang
New Contributor II
2,694 Views
Thank you very much sir, these are very good news.
0 Kudos
Reply