<-- Back

How to fix error in Android Studio for Mendix native mobile apps: A problem occurred starting process 'command 'node''

Introduction

After building a native mobile app in Mendix Studio Pro and opening the Android project in Android Studio, the following build failure error occurs:

A problem occurred starting process 'command 'node''
Cause: error=2, No such file or director

This error occurs because the Gradle build process cannot locate the Node.js executable in the system PATH. This error occurs when Android Studio's command-line tools are not properly configured or when the PATH environment variable is not accessible to Android Studio's build process.

Environment

Native Mobile

Instructions/Procedure

To resolve this error, configure the Android Studio command-line launcher and PATH variable as follows:

  1. In Android Studio, navigate to Tools > Create Command-line Launcher
  2. Confirm the creation when prompted
  3. Open the terminal
  4. Add the Android Studio path to the PATH variable by editing the shell configuration file. There are a few options on how to set it:
    1. For zsh (default on macOS)

      echo 'export PATH="/Applications/Android Studio.app/Contents/MacOS:$PATH"' >> ~/.zshrc
      source ~/.zshrc
    2. For bash (for Mac):

      echo 'export PATH="/Applications/Android Studio.app/Contents/MacOS:$PATH"' >> ~/.bash_profile
      source ~/.bash_profile
    3.  Using PowerShell (for Windows):

      [Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\Program Files\Android\Android Studio\bin", [EnvironmentVariableTarget]::User)                              
    4.  Using Command Prompt (for Windows)

      setx PATH "%PATH%;C:\Program Files\Android\Android Studio\bin" 
  5. Verify the PATH was updated:

    echo $PATH
  6. In the terminal, navigate to the Android project directory:

    cd /path/to/[LocalBuildFolder]/android
  7. Launch Android Studio from the terminal:

    studio .
  8. Once Android Studio opens with your project, go to Build > Clean Project
  9. After cleaning completes, go to Build > Rebuild Project

The build should now complete successfully without the Node.js path error.

Outcome

After following the steps, Android Studio can successfully locate the Node.js executable and the Gradle build process completes without PATH-related errors. Future builds will work correctly as the PATH variable is permanently updated.

Internal information related

Not applicable

Additional information

Not applicable

Have more questions? Submit a request

0 Comments

Article is closed for comments.

To provide feedback, please open a ticket here. Don't forget to include the article's URL along with the feedback you would like to provide.