Ionic-cli: Ionic start: Error spawn ENOENT

Created on 8 Nov 2017  ·  25Comments  ·  Source: ionic-team/ionic-cli

_From @elisea1986 on November 8, 2017 12:2_

I want to create my first app by ionic start command, but i have this issue:

√ Creating directory .\App2 - done!
Fetching app base (https://github.com/ionic-team/ionic2-app-base/archive/master.tar.gz)
events.js:183
throw er; // Unhandled 'error' event
^

Error: spawn "C:\Program Files\nodejs\node.exe" ENOENT
at notFoundError (C:\Users\elisea\AppData\Roaming\npm\node_modules\ionic\node_modules\cross-spawn\lib\enoent.js:11:11)
at verifyENOENT (C:\Users\elisea\AppData\Roaming\npm\node_modules\ionic\node_modules\cross-spawn\lib\enoent.js:46:16)
at ChildProcess.cp.emit (C:\Users\elisea\AppData\Roaming\npm\node_modules\ionic\node_modules\cross-spawn\lib\enoent.js:33:19)
at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)

Following there is a list of ionic info:
cli packages: (C:\Users\elisea\AppData\Roaming\npm\node_modules)

@ionic/cli-plugin-proxy : 1.5.4
@ionic/cli-utils        : 1.16.0
ionic (Ionic CLI)       : 3.16.0

System:

Node : v8.9.0
npm  : 5.5.1
OS   : Windows 10

Environment Variables:

HTTP_PROXY       : http://proxy.example.com:8888
http_proxy       : http://proxy.example.com:8888
HTTPS_PROXY      : http://proxy.example.com:8888
https_proxy      : http://proxy.example.com:8888
IONIC_HTTP_PROXY : http://proxy.example.com:8888
PROXY            : http://proxy.example.com:8888
proxy            : http://proxy.example.com:8888

Misc:

backend : pro

So, I am not able to create the app, only the directory of the project is created.
How can I solve the issue?

Thanks.

_Copied from original issue: ionic-team/ionic#13355_

All 25 comments

Hello! Thank you for opening an issue with us!

This is not an issue with the Ionic Framework but is potentially an issue with the CLI. I will move this issue to the CLI repo for you.

I also urge that you ask this question on our forum or on our slack channel.

Thank you for using Ionic

I've read this has to do with the new Android Studio 3 update just released a few days ago. Do you have any temporary solutions?
Thanks a lot

@krlozadan Not sure where you read that. ionic start does not use Android Studio.

@elisea1986 Can you try without @ionic/cli-plugin-proxy installed? Looks like you're using the proxy URLs from our docs (http://proxy.example.com:8888), so it won't work anyway.

Yes, I have replaced the URL of the examples, with the IP of my proxy. After creating the App, the server crashed and the error appears in the command line...then i can't use the 'ionic start' command.
@dwieeb

@elisea1986 The error you're getting is really general and hard to trace back to the root cause, so I'm just guessing at this point. Just curious, do you have git installed?

Yes

@dwieeb sorry I didn't read well the issue title, the one I'm getting is:
Error: spawn EACCES when running ionic cordova build android --release
This is the solution I read:
https://stackoverflow.com/questions/43700489/ionic-build-android-error-spawn-eacces

This is my ionic info output:
`
cli packages:
@ionic/cli-utils : 1.16.0
ionic (Ionic CLI) : 3.16.0

global packages:
cordova (Cordova CLI) : 7.0.1

local packages:
@ionic/app-scripts : 1.3.12
Cordova Platforms : android 6.3.0 ios 4.5.3
Ionic Framework : ionic-angular 3.1.0

System:
ios-deploy : 1.9.2
Node : v6.11.3
npm : 5.3.0
OS : macOS High Sierra
Xcode : Xcode 9.1 Build version 9B55

Environment Variables:
ANDROID_HOME : not set

Misc:
backend : legacy
`
In the mean time I will check why ANROID_HOME is not set

@elisea1986 Is this still an issue with CLI 3.17.0 (released yesterday)?

may be a android studio conflict... i did uninstall this program and work it

@juanvs23 Again... ionic start does not use Android Studio. You are probably looking for this issue: https://github.com/ionic-team/ionic-cli/issues/2835

@dwieeb That's correct. I've been following the issue here:
https://issues.apache.org/jira/browse/CB-13495
Thank you!

i am having the same issue can anyone help me with this issue and also no help in ionic slack channel

I am also facing the same issue and it was because network restriction. In office environment i am getting this error but in open network its working fine.

no solution from any ionic lover and it is really bad thing

@Anindo94 Any network restrictions? @vishalkm87 mentioned it could be related to network. For me, ionic start errors in a different way for me on Windows (an actual network error, instead of "unhandled 'error' event").

Maybe you are working under a proxy because I get the same error when I work using my university wifi which has a proxy.

Same here in corporate environment.
On open network it's ok.

Any workaround?

I have the same error in my project. I think it could be caused by the network but I'm not sure.

@rhenann @alierensevinc Can I see the full command output with the --verbose flag? You'll also need to figure out if you're under a proxy and the proxy details. Your computer and each CLI needs to be configured separately, unfortunately.

@dwieeb here is the full error :
Error: spawn "C:\Program Files\nodejs\node.exe" ENOENT
at notFoundError (C:\anadolusigorta\assc\app\node_modules\cross-spawn\lib\enoent.js:11:11)
at verifyENOENT (C:\anadolusigorta\assc\app\node_modules\cross-spawn\lib\enoent.js:46:16)
at ChildProcess.cp.emit (C:\anadolusigorta\assc\app\node_modules\cross-spawn\lib\enoent.js:33:19)
at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)

And yes I'm under proxy. I will try to reconfigure my cli. Thank you 👍

@dwieeb I was able to solve the problem by configuring the proxy in .npmrc. I think the problem was just this.

proxy=[YOUR_CORP_PROXY]
https-proxy=[YOUR_CORP_PROXY]

@rhenann @alierensevinc Thank you! I'm guessing Node errors differently depending on how the proxy server refuses the connection. I will try to catch this issue and offer a better explanation. 👍

So it was a proxy issue for me... Removing npm proxy worked...
But out of curiosity, why does ionic serve require network access... I mean it should run without raising any network requests (hence no proxy issue), right?

@virtualvishwam ionic serve defaults to binding on all network interfaces (0.0.0.0) for ease of use (sharing with coworkers, for example). We also wanted it to work with the DevApp without any additional configuration, which means external network is required. When we made this change, I added a convenient --local flag which disables the DevApp logic and binds to localhost.

The problem may come from windows services. Windows child process services not running properly.
In windows, OS => Go to System Config and enable all services and restart the computer. For more details check here.

Was this page helpful?
0 / 5 - 0 ratings