ENOENT spawn error with ionic start


#1

Hi,
I upgraded to beta.23 and started to get an error when created a new project using ‘ionic start foo --v2 --verbose’.
The error in red says
"Unable to spawn commandError: spawn npm ENOENT (CLI v2.0.0-beta.23)."

I have npm installed and can run from Windows 8 cmd line.
I tried upgrade to node v5.9.1.
I confirmed npm is in the PATH environment variable and can run npm from cmd shell.
Any ideas how to fix or debug further would be appreciated.

Here is the complete output:
C:\ionic2>ionic start foo --v2 --verbose
Task setting: title=start, name=start, summary=Starts a new Ionic project in the
specified PATH, [options]=any flags for the command, =directory for the n
ew project, [template]=Starter templates can either come from a named template,

(ex: tabs, sidemenu, blank),
a Github repo, a Codepen url, or a local directory.
Codepen url, ex: http://codepen.io/ionic/pen/odqCz
Defaults to Ionic “tabs” starter template, --appname|-a=Human readable name for
the app (Use quotes around the name), --id|-i=Package name for confi
g, ex: com.mycompany.myapp, title=Skip npm package installation, boolean=true, t
itle=Create a basic structure without Cordova requirements, boolean=true, title=
Setup the project to use Sass CSS precompiling, boolean=true, title=List starter
templates available, boolean=true, --io-app-id=The Ionic.io app ID to use, --te
mplate|-t=Project starter template, boolean=true, title=Start a Ionic v2 project
, boolean=true, title=(with --v2 only) Use TypeScript in starter, --zip-file|-z=
URL to download zipfile for starter template, module=./ionic/start, disableChang
ePwd=true
Utils.preprocessCliOptions _=[start, foo], skip-npm=false, no-cordova=false, w=f
alse, sass=false, s=false, list=false, l=false, v2=true, v=false, typescript=fal
se, -ts=false, verbose=true, $0=C:\Program Files\nodejs\node.exe C:\Users\bradtk
e\AppData\Roaming\npm\node_modules\ionic\bin\ionic

One awesome Ionic app coming right up…

Creating Ionic app in folder C:\ionic2\foo based on tabs project
Downloading: https://github.com/driftyco/ionic2-app-base/archive/master.zip
[=============================] 100% 0.0s
Downloading: https://github.com/driftyco/ionic2-starter-tabs/archive/master.zip
[=============================] 100% 0.0s
Installing npm packages…
Running exec command: npminstall
Utils.fail Unable to run spawn commandError: spawn npm ENOENT undefined
Utils.fail stack undefined
Utils.errorHandler is set, calling that now
Cli.Utils.errorHandler msg Unable to run spawn commandError: spawn npm ENOENT st
ring

Unable to run spawn commandError: spawn npm ENOENT (CLI v2.0.0-beta.23)

Your system information:

Cordova CLI: 6.1.0 (cordova-lib@undefined)
Ionic CLI Version: 2.0.0-beta.23
Ionic App Lib Version: 2.0.0-beta.13
OS: Windows 8.1
Node Version: v5.9.1

Regards,
bruce


#2

Getting the same error.

One awesome Ionic app coming right up…

Creating Ionic app in folder C:\work\me\ionic\mappskool based on tabs project
Downloading: https://github.com/driftyco/ionic2-app-base/archive/master.zip
[=============================] 100% 0.0s
Downloading: https://github.com/driftyco/ionic2-starter-tabs/archive/master.zip
[=============================] 100% 0.0s
Installing npm packages…

Unable to run spawn commandError: spawn npm ENOENT (CLI v2.0.0-beta.23)

Your system information:

Cordova CLI: 6.0.0
Gulp version: CLI version 3.9.0
Gulp local:
Ionic CLI Version: 2.0.0-beta.23
Ionic App Lib Version: 2.0.0-beta.13
OS: Windows 7 SP1
Node Version: v4.2.4


#3

I resolved the error by downgrading to beta.22. There must be an issue with beta.23 and our environments.

Try this:
npm install -g ionic@2.0.0-beta.22


#4

I resolved it by doing npm install manually in ionic project dir.

ionic CLI has this issue and not able to create a blank project and install related node modules.


#5

Thanks @bradtke , your tips useful to me.


#6

Maybe it has to do with the latest Angular. Latest beta has a bug and they are recommending to downgrade.


#7

Same problem here too !!!


#8

Same here !!!


#9

Where have they recommended this?


#10

It was in the main page in Angular.io

That was for beta 12 though.


#11

What does that have to do with this CLI issue?


#12

Just trying to trying options. If you eliminate any of the problems whatever is left is the result.