• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Run gulp from Air Application

Community Beginner ,
Oct 17, 2017 Oct 17, 2017

Copy link to clipboard

Copied

I am trying to run a gulp task from my air application on mac using NativeProcess class. It works like charm when compiling and running from intellij but not when compiling a dmg with extendedDesktop profile. It seems to be the problem that air cannot find gulp, at least this is the response (command not found).

When trying to get down to the problem i found out, that air doesnt recognize the /usr folder where gulp is installed (even when installed global via "sudo npm install gulp-cli -g". It's not possibly to locate gulp installation.

Again: common commands like "zip" or something already work with the compiled dmg file. it's just i can't make gulp to be found by the compiled app. same code run by intellij working.

Anyone any idea?

Thank you!

TOPICS
Development

Views

334

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Oct 17, 2017 Oct 17, 2017

Copy link to clipboard

Copied

what is the command-line you use in AIR ?
how did you install node/npm and gulp ? homebrew ? macport ? other?

try to run those commands from AIR native process and see their output

"which gulp"

"command -v 'gulp'"

try also
"printenv"

and look in PATH=...
see if the path where gulp is installed is there

also if some of those commands output to stderr instead of stdout
you will need to redirect stderr to stdout

for example:

java -version
will output to stderr

you would need to do

java -version 2>&1

so the stderr is redirected to stdout

some things to explore

1. "gulp"
if command not found
then use "which gulp" or "command -v gulp"
to find the full path, for ex it could returns "/usr/bin/gulp"

2. then try to call gulp with the fullpath eg. "/usr/bin/gulp"


3. the problem could be node
in gulp/gulp.js at master · gulpjs/gulp · GitHub
you can see "#!/usr/bin/env node"

maybe gulp can not find "node" with the "env" command

4. the problem could be your $PATH

if gulp is installed in a local directory like "/opt/local/bin"
maybe this path is not in the PATH environnement variable
and then even if gulp is installed it would not be found


If all that still does not work you could explore the idea
of converting gulp to an executable with such tools
as nexe, node-compile, node-compiler, etc.

and then distribute the exe within the AIR app

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Oct 17, 2017 Oct 17, 2017

Copy link to clipboard

Copied

LATEST

You are possibly pointing to a shortcut and not the real app.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines