Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ERROR: native-run was not found on your PATH. (Ionic 4)

Out of nowhere, being able to deploy my app to android in the recent past I am now receiving this error when trying to run 'ionic cordova run android'

[ERROR] native-run was not found on your PATH. Please install it globally: npm i -g native-run

When I run 'ionic info' under Utilities I see cordova-res and native-run are installed, but still this error recurs, every time.

Sidenote: 'npm i -g native-run' does not resolve this issue, the error just recurs

Performing ls /usr/local/lib/node_modules returns: 'ionic cordova npm' (no sign of native-run, which should be there)

Is there a way I can install it directly to that location? Any help would be greatly appreciated.

like image 230
James Slater Avatar asked Aug 21 '19 09:08

James Slater


2 Answers

I got this issue too. Here is what I did to fix it.

1 - Run ionic info at the root of your Ionic project you should get something like.

Ionic:
   Ionic CLI                     : 5.2.4 (/usr/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.9.0
   @angular-devkit/build-angular : 0.801.3
   @angular-devkit/schematics    : 8.1.3
   @angular/cli                  : 8.1.3
   @ionic/angular-toolkit        : 2.0.0

Cordova:
   Cordova CLI       : 9.0.0 ([email protected])
   Cordova Platforms : android 8.0.0
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.1.1, (and 4 other plugins)

Utility:
   cordova-res : 0.6.0 
   native-run  : 0.2.8 

System:
   NodeJS : v10.16.3 (/usr/bin/node)
   npm    : 6.9.0
   OS     : Linux 5.0

2 - Run cd /usr/lib (The directory where your Ionic CLI is installed) then you run npm install native-run.

3 - Run ln -s /usr/lib/node_modules/native-run/bin/native-run /usr/bin/native-run this will create a link to your binary file.

Then you should be good.

like image 167
Thomas Morrier-Bompoint Avatar answered Nov 15 '22 01:11

Thomas Morrier-Bompoint


you have to update your libraries using :

npm i -g native-run@latest
like image 20
med elamine Mahmoudi Avatar answered Nov 15 '22 01:11

med elamine Mahmoudi