Error after update to ionic 3.6

Hello.
I have been using version 3.5, yesterday update to version 3.6 and now I can not do anything from the command line unsando ionic.
The error is
events.js:182
throw er; // Unhandled ‘error’ event
^

Error: spawn C:\Program Files\nodejs\node.exe ENOENT
at notFoundError (C:\Proyectos\Ionic_Proyects\I3Recibo\node_modules\cross-spawn\lib\enoent.js:11:11)
at verifyENOENT (C:\Proyectos\Ionic_Proyects\I3Recibo\node_modules\cross-spawn\lib\enoent.js:46:16)
at ChildProcess.cp.emit (C:\Proyectos\Ionic_Proyects\I3Recibo\node_modules\cross-spawn\lib\enoent.js:33:19)
at Process.ChildProcess._handle.onexit (internal/child_process.js:197:12)

What I can do?

Thank you.

Post your ionic info please.

ionic-angular 3.6.0 requires developer’s to update to the latest version of the Ionic CLI and @ionic/app-scripts.

Sorry, but when I run the command ionic info it gives me the error that I send.

events.js:182
throw er; // Unhandled ‘error’ event
^

Error: spawn C:\Program Files\nodejs\node.exe ENOENT
at notFoundError (C:\Proyectos\Ionic_Proyects\I3Recibo\node_modules\cross-spawn\lib\enoent.js:11:11)
at verifyENOENT (C:\Proyectos\Ionic_Proyects\I3Recibo\node_modules\cross-spawn\lib\enoent.js:46:16)
at ChildProcess.cp.emit (C:\Proyectos\Ionic_Proyects\I3Recibo\node_modules\cross-spawn\lib\enoent.js:33:19)
at Process.ChildProcess._handle.onexit (internal/child_process.js:197:12)

What is your npm version ? Same as the cordova version ?

npm -v
cordova -v

Did you update Ionic CLI or ionic-angular?
Any way, how exactly did you upgrade?

Run npm list -g --depth=0 and post the result here.

npm -v 5.0.3
cordova -v 7.0.1

Probe the command ionic info in another folder other than the project and it works.
The ionic info command executed in another folder

[WARN] You are not in an Ionic project directory. Project context may be missing.

cli packages:

    @ionic/cli-utils  : 1.6.0 (C:\Users\HP\AppData\Roaming\npm\node_modules\ionic\node_modules\@ionic\cli-utils)
    ionic (Ionic CLI) : 3.6.0 (C:\Users\HP\AppData\Roaming\npm\node_modules\ionic)

System:

    Node : v8.1.2
    OS   : Windows 10
    npm  : 5.0.3

The command npm list -g --depth=0

C:\Users\HP\AppData\Roaming\npm
±- cordova@7.0.1
`-- ionic@3.6.0

Now package.json of the project where you can not run any ionic commands.

File package.json

{
    "name": "I3Recibo",
    "version": "0.0.1",
    "author": "Ionic Framework",
    "homepage": "http://ionicframework.com/",
    "private": true,
    "scripts": {
        "clean": "ionic-app-scripts clean",
        "build": "ionic-app-scripts build",
        "lint": "ionic-app-scripts lint",
        "ionic:build": "ionic-app-scripts build",
        "ionic:serve": "ionic-app-scripts serve"
    },
    "dependencies": {
        "@angular/common": "4.1.3",
        "@angular/compiler": "4.1.3",
        "@angular/compiler-cli": "4.1.3",
        "@angular/core": "4.1.3",
        "@angular/forms": "4.1.3",
        "@angular/http": "4.1.3",
        "@angular/platform-browser": "4.1.3",
        "@angular/platform-browser-dynamic": "4.1.3",
        "@ionic-native/core": "3.12.1",
        "@ionic-native/printer": "^4.1.0",
        "@ionic-native/splash-screen": "3.12.1",
        "@ionic-native/status-bar": "3.12.1",
        "@ionic/cloud-angular": "^0.9.1",
        "@ionic/storage": "2.0.1",
        "cordova-android": "^6.2.3",
        "cordova-plugin-console": "^1.0.7",
        "cordova-plugin-device": "^1.1.6",
        "cordova-plugin-splashscreen": "^4.0.3",
        "cordova-plugin-statusbar": "^2.2.3",
        "cordova-plugin-whitelist": "^1.3.2",
        "de.appplant.cordova.plugin.printer": "^0.7.3",
        "ionic-angular": "^3.6.0",
        "ionic-plugin-keyboard": "^2.2.1",
        "ionicons": "3.0.0",
        "rxjs": "5.4.0",
        "sw-toolbox": "3.6.0",
        "target": "0.0.2",
        "zone.js": "0.8.12"
    },
    "devDependencies": {
        "@ionic/app-scripts": "^2.1.3",
        "@ionic/cli-plugin-cordova": "1.5.0",
        "@ionic/cli-plugin-ionic-angular": "1.4.0",
        "ionic": "3.6.0",
        "typescript": "2.3.4"
    },
    "description": "An Ionic project",
    "cordova": {
        "plugins": {
            "cordova-plugin-console": {},
            "cordova-plugin-device": {},
            "cordova-plugin-splashscreen": {},
            "cordova-plugin-statusbar": {},
            "cordova-plugin-whitelist": {},
            "ionic-plugin-keyboard": {},
            "de.appplant.cordova.plugin.printer": {}
        },
        "platforms": [
            "android"
        ]
    }
}

Delete and reinstall the modules, the command ionic serve works fine, but when I want to execute the command ionic cordova run android it gives me the error and then I can not re-execute anymore the command ionic serve
I have problems with cordova modules?

Your devDependencies look ok.

Can you run the commands in the project with --verbose added it at the end pleasE?

Yes no problem.

The result of commands are:

> ionic serve --verbose
[DEBUG] CLI flags: { interactive: true, confirm: false }
[DEBUG] { cwd: 'C:\\Proyectos\\Ionic_Proyects\\I3Recibo', local: true, binPath:
        'C:\\Users\\HP\\AppData\\Roaming\\npm\\node_modules\\ionic\\bin\\ionic', libPath:
        'C:\\Proyectos\\Ionic_Proyects\\I3Recibo\\node_modules\\ionic\\dist\\index.js' }
[DEBUG] Loading local plugin @ionic/cli-plugin-proxy
[DEBUG] Throwing PLUGIN_NOT_INSTALLED for local @ionic/cli-plugin-proxy
[DEBUG] Loading local plugin @ionic/cli-plugin-cordova
[DEBUG] Loading local plugin @ionic/cli-plugin-ionic-angular
[DEBUG] Getting plugin info for ionic
[DEBUG] Checking for latest plugin version of ionic@latest.
[DEBUG] Getting plugin info for @ionic/cli-plugin-cordova
[DEBUG] Checking for latest plugin version of @ionic/cli-plugin-cordova@latest.
[DEBUG] Getting plugin info for @ionic/cli-plugin-ionic-angular
[DEBUG] Checking for latest plugin version of @ionic/cli-plugin-ionic-angular@latest.
[DEBUG] New daemon pid: 82176

	events.js:182
      throw er; // Unhandled 'error' event
      ^

Error: spawn C:\Program Files\nodejs\node.exe ENOENT
    at notFoundError (C:\Proyectos\Ionic_Proyects\I3Recibo\node_modules\cross-spawn\lib\enoent.js:11:11)
    at verifyENOENT (C:\Proyectos\Ionic_Proyects\I3Recibo\node_modules\cross-spawn\lib\enoent.js:46:16)
    at ChildProcess.cp.emit (C:\Proyectos\Ionic_Proyects\I3Recibo\node_modules\cross-spawn\lib\enoent.js:33:19)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:197:12)
	
	
>npm list -g --depth=0 --verbose
npm info it worked if it ends with ok
npm verb cli [ 'C:\\Program Files\\nodejs\\node.exe',
npm verb cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
npm verb cli   'list',
npm verb cli   '-g',
npm verb cli   '--depth=0',
npm verb cli   '--verbose' ]
npm info using npm@5.0.3
npm info using node@v8.1.2
C:\Users\HP\AppData\Roaming\npm
+-- cordova@7.0.1
`-- ionic@3.6.0

npm verb exit [ 0, true ]
npm info ok



>ionic cordova run android --verbose
[DEBUG] CLI flags: { interactive: true, confirm: false }
[DEBUG] { cwd: 'C:\\Proyectos\\Ionic_Proyects\\I3Recibo', local: true, binPath:
        'C:\\Users\\HP\\AppData\\Roaming\\npm\\node_modules\\ionic\\bin\\ionic', libPath:
        'C:\\Proyectos\\Ionic_Proyects\\I3Recibo\\node_modules\\ionic\\dist\\index.js' }
[DEBUG] Loading local plugin @ionic/cli-plugin-proxy
[DEBUG] Throwing PLUGIN_NOT_INSTALLED for local @ionic/cli-plugin-proxy
[DEBUG] Loading local plugin @ionic/cli-plugin-cordova
[DEBUG] Loading local plugin @ionic/cli-plugin-ionic-angular
[DEBUG] New daemon pid: 80176
[DEBUG] Getting plugin info for ionic
[DEBUG] Checking for latest plugin version of ionic@latest.
[DEBUG] Getting plugin info for @ionic/cli-plugin-cordova
[DEBUG] Checking for latest plugin version of @ionic/cli-plugin-cordova@latest.
[DEBUG] Getting plugin info for @ionic/cli-plugin-ionic-angular
[DEBUG] Checking for latest plugin version of @ionic/cli-plugin-ionic-angular@latest.

	events.js:182
      throw er; // Unhandled 'error' event
      ^

Error: spawn C:\Program Files\nodejs\node.exe ENOENT
    at notFoundError (C:\Proyectos\Ionic_Proyects\I3Recibo\node_modules\cross-spawn\lib\enoent.js:11:11)
    at verifyENOENT (C:\Proyectos\Ionic_Proyects\I3Recibo\node_modules\cross-spawn\lib\enoent.js:46:16)
    at ChildProcess.cp.emit (C:\Proyectos\Ionic_Proyects\I3Recibo\node_modules\cross-spawn\lib\enoent.js:33:19)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:197:12)

You mentioned that you can run the commands after installing the modules. Could you do that for ionic info please?

>ionic info --verbose
[DEBUG] CLI flags: { interactive: true, confirm: false }
[DEBUG] { cwd: 'C:\\Proyectos\\Ionic_Proyects\\I3Recibo', local: true, binPath:
        'C:\\Users\\HP\\AppData\\Roaming\\npm\\node_modules\\ionic\\bin\\ionic', libPath:
        'C:\\Proyectos\\Ionic_Proyects\\I3Recibo\\node_modules\\ionic\\dist\\index.js' }
[DEBUG] Loading local plugin @ionic/cli-plugin-proxy
[DEBUG] Throwing PLUGIN_NOT_INSTALLED for local @ionic/cli-plugin-proxy
[DEBUG] Loading local plugin @ionic/cli-plugin-cordova
[DEBUG] Loading local plugin @ionic/cli-plugin-ionic-angular
[DEBUG] New daemon pid: 54004
[DEBUG] Getting plugin info for ionic
[DEBUG] Checking for latest plugin version of ionic@latest.
[DEBUG] Getting plugin info for @ionic/cli-plugin-cordova
[DEBUG] Checking for latest plugin version of @ionic/cli-plugin-cordova@latest.
[DEBUG] Getting plugin info for @ionic/cli-plugin-ionic-angular
[DEBUG] Checking for latest plugin version of @ionic/cli-plugin-ionic-angular@latest.
\ Gathering environment info
events.js:182
      throw er; // Unhandled 'error' event
      ^

Error: spawn C:\Program Files\nodejs\node.exe ENOENT
    at notFoundError (C:\Proyectos\Ionic_Proyects\I3Recibo\node_modules\cross-spawn\lib\enoent.js:11:11)
    at verifyENOENT (C:\Proyectos\Ionic_Proyects\I3Recibo\node_modules\cross-spawn\lib\enoent.js:46:16)
    at ChildProcess.cp.emit (C:\Proyectos\Ionic_Proyects\I3Recibo\node_modules\cross-spawn\lib\enoent.js:33:19)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:197:12)

Pure guess:

Remove these two from package.json, nuke your node_modules and run npm install. Then see what the CLI does (Should prompt you to install the plugins)

1 Like

I hv exactly the same problem here.

I deleted the
@ionic/cli-plugin-cordova”: “1.5.0”,
"@ionic/cli-plugin-ionic-angular": “1.4.0”,
and nuke the node modules folder.

Same situation remains:

events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: spawn C:\Program Files\nodejs\node.exe ENOENT
    at notFoundError (D:\MyCloud\git\cow-v2\node_modules\cross-spawn\lib\enoent.js:11:11)
    at verifyENOENT (D:\MyCloud\git\cow-v2\node_modules\cross-spawn\lib\enoent.js:46:16)
    at ChildProcess.cp.emit (D:\MyCloud\git\cow-v2\node_modules\cross-spawn\lib\enoent.js:33:19)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
> ionic info --verbose
[DEBUG] CLI flags: { interactive: true, confirm: false }
[DEBUG] { cwd: 'C:\\Proyectos\\Ionic_Proyects\\I3Recibo', local: true, binPath:
        'C:\\Users\\HP\\AppData\\Roaming\\npm\\node_modules\\ionic\\bin\\ionic', libPath:
        'C:\\Proyectos\\Ionic_Proyects\\I3Recibo\\node_modules\\ionic\\dist\\index.js' }
[DEBUG] Loading local plugin @ionic/cli-plugin-proxy
[DEBUG] Throwing PLUGIN_NOT_INSTALLED for local @ionic/cli-plugin-proxy
[DEBUG] Loading local plugin @ionic/cli-plugin-ionic-angular
[DEBUG] New daemon pid: 77960
[DEBUG] Getting plugin info for ionic
[DEBUG] Checking for latest plugin version of ionic@latest.
[DEBUG] Getting plugin info for @ionic/cli-plugin-ionic-angular
[DEBUG] Checking for latest plugin version of @ionic/cli-plugin-ionic-angular@latest.

cli packages:

    @ionic/cli-plugin-ionic-angular : 1.4.0 (C:\Proyectos\Ionic_Proyects\I3Recibo\node_modules\@ionic\cli-plugin-ionic-angular)
    @ionic/cli-utils                : 1.6.0 (C:\Proyectos\Ionic_Proyects\I3Recibo\node_modules\@ionic\cli-utils)
    ionic (Ionic CLI)               : 3.6.0 (C:\Proyectos\Ionic_Proyects\I3Recibo\node_modules\ionic)

local packages:

    @ionic/app-scripts : 2.1.3
    Ionic Framework    : ionic-angular 3.6.0

System:

    Node : v8.1.2
    OS   : Windows 10
    npm  : 5.0.3

The command ionic serve now it works :slight_smile:

But to run on my android? What do you recommends me to do?

Thank for your helps :slight_smile:

Hmm, so as long as you don’t run any ionic cordova command, which will add the cordova plugin, everything is fine?

Can you confirm that again by running ionic cordova platform list --verbose?

I created an issue for this error: https://github.com/ionic-team/ionic-cli/issues/2574

>ionic cordova platform list --verbose
[DEBUG] CLI flags: { interactive: true, confirm: false }
[DEBUG] { cwd: 'C:\\Proyectos\\Ionic_Proyects\\I3Recibo', local: true, binPath:
        'C:\\Users\\HP\\AppData\\Roaming\\npm\\node_modules\\ionic\\bin\\ionic', libPath:
        'C:\\Proyectos\\Ionic_Proyects\\I3Recibo\\node_modules\\ionic\\dist\\index.js' }
[DEBUG] Loading local plugin @ionic/cli-plugin-proxy
[DEBUG] Throwing PLUGIN_NOT_INSTALLED for local @ionic/cli-plugin-proxy
[DEBUG] Loading local plugin @ionic/cli-plugin-ionic-angular
[DEBUG] New daemon pid: 81948
[DEBUG] Getting plugin info for ionic
[DEBUG] Checking for latest plugin version of ionic@latest.
[DEBUG] Getting plugin info for @ionic/cli-plugin-ionic-angular
[DEBUG] Checking for latest plugin version of @ionic/cli-plugin-ionic-angular@latest.
[DEBUG] Loading local plugin @ionic/cli-plugin-cordova
? The plugin @ionic/cli-plugin-cordova is not installed. Would you like to install it and continue? Yes
> npm install --save-dev --save-exact @ionic/cli-plugin-cordova@latest
√ Running command - done!
[DEBUG] Loading local plugin @ionic/cli-plugin-cordova
> cordova platform ls
√ Running command - done!
Installed platforms:

Available platforms:
  android ~6.2.2
  blackberry10 ~3.8.0 (deprecated)
  browser ~4.1.0
  webos ~3.7.0
  windows ~5.0.0

And next execute the command

>ionic cordova run android --verbose
[DEBUG] CLI flags: { interactive: true, confirm: false }
[DEBUG] { cwd: 'C:\\Proyectos\\Ionic_Proyects\\I3Recibo', local: true, binPath:
        'C:\\Users\\HP\\AppData\\Roaming\\npm\\node_modules\\ionic\\bin\\ionic', libPath:
        'C:\\Proyectos\\Ionic_Proyects\\I3Recibo\\node_modules\\ionic\\dist\\index.js' }
[DEBUG] Loading local plugin @ionic/cli-plugin-proxy
[DEBUG] Throwing PLUGIN_NOT_INSTALLED for local @ionic/cli-plugin-proxy
[DEBUG] Loading local plugin @ionic/cli-plugin-cordova
[DEBUG] Loading local plugin @ionic/cli-plugin-ionic-angular
[DEBUG] Getting plugin info for ionic
[DEBUG] Checking for latest plugin version of ionic@latest.
[DEBUG] Getting plugin info for @ionic/cli-plugin-cordova
[DEBUG] Checking for latest plugin version of @ionic/cli-plugin-cordova@latest.
[DEBUG] Getting plugin info for @ionic/cli-plugin-ionic-angular
[DEBUG] Checking for latest plugin version of @ionic/cli-plugin-ionic-angular@latest.
[DEBUG] Daemon found (pid: 80924)
> cordova platform add --save android
√ Running command - done!
Running app-scripts build: --address 0.0.0.0 --port 8100 --p 8100 --livereload-port 35729 --r 35729 --iscordovaserve --externalIpRequired --nobrowser

[11:17:49]  build dev started ...
[11:17:49]  clean started ...
[11:17:49]  clean finished in 10 ms
[11:17:49]  copy started ...
[11:17:49]  transpile started ...
[11:17:52]  transpile finished in 3.18 s
[11:17:52]  preprocess started ...
[11:17:52]  deeplinks started ...
[11:17:52]  deeplinks finished in 84 ms
[11:17:52]  preprocess finished in 86 ms
[11:17:52]  webpack started ...
[11:17:52]  copy finished in 3.42 s
[11:17:59]  webpack finished in 7.65 s
[11:17:59]  sass started ...
[11:18:00]  sass finished in 952 ms
[11:18:00]  postprocess started ...
[11:18:00]  postprocess finished in 4 ms
[11:18:00]  lint started ...
[11:18:00]  build dev finished in 11.94 s
> cordova run android
[11:18:05]  tslint: ...Proyectos/Ionic_Proyects/I3Recibo/src/pages/print-ticket/print-ticket.ts, line: 3
            All imports are unused.

       L2:  import { NavController, NavParams, IonicPage } from 'ionic-angular';
       L3:  import { Printer, PrintOptions } from '@ionic-native/printer';

[11:18:05]  lint finished in 4.27 s
ANDROID_HOME=C:\Users\HP\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\java\jdk1.8.0_131
Starting a Gradle Daemon (subsequent builds will be faster)

:wrapper


BUILD SUCCESSFUL

Total time: 27.196 secs
Subproject Path: CordovaLib
Starting a Gradle Daemon (subsequent builds will be faster)
...
BUILD SUCCESSFUL

Total time: 1 mins 5.516 secs
Built the following apk(s):
        C:/Proyectos/Ionic_Proyects/I3Recibo/platforms/android/build/outputs/apk/android-debug.apk
ANDROID_HOME=C:\Users\HP\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\java\jdk1.8.0_131
No target specified, deploying to device 'BHG7N16302014687'.
Skipping build...
Built the following apk(s):
        C:/Proyectos/Ionic_Proyects/I3Recibo/platforms/android/build/outputs/apk/android-debug.apk
Using apk: C:/Proyectos/Ionic_Proyects/I3Recibo/platforms/android/build/outputs/apk/android-debug.apk
Package name: io.ionic.starter
LAUNCH SUCCESS

Now works!!! the program very good in my android.
Than you for the help and for his effort :slight_smile: