Ionic-cli: Trying to start with --v2 --ts throws an error

Created on 19 May 2016  ·  60Comments  ·  Source: ionic-team/ionic-cli

_From @KerryRitter on April 30, 2016 16:31_

Here is my command line output:

c:\Workspaces\RevRadio\mobile>ionic start revradio --v2 --ts
Creating Ionic app in folder c:\Workspaces\RevRadio\mobile\revradio based on tabs project
Downloading: https://github.com/driftyco/ionic2-app-base/archive/typescript.zip
[=============================]  100%  0.0s
Downloading: https://github.com/driftyco/ionic2-starter-tabs/archive/typescript.zip
[=============================]  100%  0.0s
Installing npm packages...
Error with start undefined
Error Initializing app: There was an error with the spawned command: npminstall
There was an error with the spawned command: npminstall

Running the install without the --ts argument works as expected.

_Copied from original issue: driftyco/ionic2-app-base#24_

Most helpful comment

i already have git installed and still i am getting above error.

All 60 comments

_From @mhartington on April 30, 2016 23:58_

What's your node version, npm version and ionic cli version

_From @KerryRitter on May 1, 2016 13:55_

Sorry bout that.

npm -v = 3.3.12
node -v = 5.1.0
ionic-v = 2.0.0-beta.25

_From @vg33 on May 17, 2016 6:48_

I'm having exactly the same issue, with the following versions:

npm -v = 3.3.12
node -v = 5.4.0
ionic -v = 2.0.0-beta.25

Any suggestions?

After the latest update (or re-install), i'm no longer having this problem. Perhaps it is resolved.

I'm having the issue with Node 5.11. Will try updating to 5.4.

Sorry - ignore my last comment. I did a reinstall of Ionic and I'm not at beta.26. I still have the same issue, _unless_ I use sudo to make the app.

So... maybe I was wrong to use sudo to install ionic? But I had done that before with v1 and had no problem making apps.

I don't quite see how using sudo to install the Ionic CLI would make the _apps_ generated by it not work right unless run with sudo.

I know some folks recommend against using sudo when installing CLI apps globally, but I always thought it was more a suggestion then anything else.

I'm having the same issue with

npm -v = 1.3.10
node -v = v0.10.25
ionic -v = 2.0.0-beta.30

(on Ubuntu 14.04)

I previously had ionic 1.0 installed,
but have run this as root:
npm uninstall -g ionic ; npm uninstall -g cordova ; npm cache clear ; npm cache clean
to clean up before installing the beta

** except in my case I get the same error with --v2 or with both --v2 and --ts
(using "blank" or "tabs" base project)

The following all give the same error:
ionic start beta2 --v2
ionic start beta2 blank --v2
ionic start betawesome blank --v2 --ts
sudo ionic start betawesome blank --v2 --ts

This Works:
ionic start dummy
(but of course I get a v1 app)

On OSX I resolved this by installing npm as non-root. I followed the steps in the following article: https://johnpapa.net/how-to-use-npm-global-without-sudo-on-osx/

Now it works like a charm.

@104player The beta requires at least node v0.12. Could you please update and try the command again?

Thanks!
Good to know...
I'm just using the node and npm that Ubuntu 14.04 gives me at the moment.

  • for now I am using Docker to get my node 5 as a workaround:

Dockerfile

FROM node:5-onbuild
RUN npm install -g ionic@beta


docker build -t ionic-beta .

docker run -t -i -v $HOME/git/ionic/:/ionic/ ionic-beta /bin/bash

then I can run it..

  • still have to try a nice way to fix up permissions, for now doing
    chown -R 1000 .
    as needed

@104player Usually Ubuntu has old versions of node available within their distribution network. Luckly nodesource hosts new versions. If you would like to update your native os distro instead of using docker you can follow these instructions. https://github.com/nodesource/distributions#installation-instructions

in my case, i was using very old npm (version less that less than 2.0).
i made it working by updating the npm to 3.9.5.

The error provided is very general and appears to not be providing enough insight for CLI users. I will work on improving this messaging so that we can get better details.

Usually providing the --verbose flag and provide more insight into the issue that is occuring.
Example: ionic start cutePuppyPics --v2 --verbose

I'm getting the same error on OS X 10.11.5 with npm 3.10.3, node v4.4.7 and ionic 2.0.0-beta.32.

Running ionic start cutePuppyPics --v2 --verbose gives (skipping the beginning as everything seems to be okay there):

[...]
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
npm
ERR! Darwin 15.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v4.4.7
npm ERR! npm v3.10.3
npm
ERR! path /Users/hhiptmair/.npm/inquirer/0.11.0
npm ERR! code EACCES

npm
ERR! errno -13
npm ERR! syscall mkdir

npm ERR!
Error: EACCES: permission denied, mkdir '/Users/hhiptmair/.npm/inquirer/0.11.0'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES: permission denied, mkdir '/Users/hhiptmair/.npm/inquirer/0.11.0']
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/Users/hhiptmair/.npm/inquirer/0.11.0',
npm
ERR! parent: 'ionic-angular' }
npm ERR!

npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR! /Users/hhiptmair/Sites/cutePuppyPics/npm-debug.log

Spawn command completed
Error with start undefined
Error Initializing app: There was an error with the spawned command: npminstall
There was an error with the spawned command: npminstall
Caught exception:
undefined

Mind letting us know? https://github.com/driftyco/ionic-cli/issues

EDIT: sorry, maybe I was a bit too fast before asking here. after removing node and npm and installing it again, it works now

@hhiptmair Looks like you might have installed node as admin. Could you try running the start command with sudo? sudo ionic start cutePuppyPics --v2 --verbose

@jthoms1 yep, you were right. i was able to recreate this issue by installing node as admin and then it worked running ionic with sudo.
nevertheless, i think the better solution is to fix the node-installation. for me, this was done by removing node and npm completely and then just using the official installer.
thanks for your help!

I am closing this issue. It has been kind of a catch all for npm install issues from ionic start. If you are having issues please try running with the verbose flag.

sudo ionic start cutePuppyPics --v2 --verbose

This should provide more insight into what is happening. In most cases it will report issues with network connectivity or permissions issues. If this is not the case please open an issue with your ionic info output.

Spawn command completed
Error with start undefined
Error Initializing app: There was an error with the spawned command: npminstall
There was an error with the spawned command: npminstall
Caught exception:
undefined

i have this same error
You have been opted out of telemetry. To change this, run: cordova telemetry on.
6.3.1

Ionic CLI Version: 2.1.0-beta.3
Ionic App Lib Version: 2.1.0-beta.1
OS:
Node Version: v4.6.0

E:\SocialLoginDemo>ionic start HelloWorld12 blank --v2
Creating Ionic app in folder E:\SocialLoginDemo\HelloWorld12 based on blank project
Downloading: https://github.com/driftyco/ionic2-app-base/archive/master.zip
[=============================] 100% 0.0s
Downloading: https://github.com/driftyco/ionic2-starter-blank/archive/master.zip
[=============================] 100% 0.0s
Installing npm packages...
Error with start undefined
Error Initializing app: There was an error with the spawned command: npminstall
There was an error with the spawned command: npminstall
Caught exception:
undefined

Mind letting us know? https://github.com/driftyco/ionic-cli/issues

my version information
E:\SocialLoginDemo>ionic info

Your system information:

You have been opted out of telemetry. To change this, run: cordova telemetry on.
6.3.1

Ionic CLI Version: 2.1.0
Ionic App Lib Version: 2.1.0-beta.1
OS:
Node Version: v4.6.0


Dependency warning - for the CLI to run correctly,
it is highly recommended to install/upgrade the following:

Please install your Cordova CLI to version >=4.2.0 npm install -g cordova

please help for same

I had a same issue when starting a new ionic project with ionic start projectname blank --v2 command on Windows 7.

Error with start undefined
Error Initializing app: There was an error with the spawned command: npminstall
There was an error with the spawned command: npminstall

The issue is now fixed.

My methods are:

  1. Choose the option "Run Git from Windows Command Prompt" when reinstalling Git.
  2. Right click the Command Prompt and choose Run as an administrator (It is not permitted to make any changes, e.g: mkdir or install, with my user account. Don't know why).

On mac the problem is the npm sudo permissions.

To solve this, you can see https://docs.npmjs.com/getting-started/fixing-npm-permissions

@chenbobowu Thanks!!!
已经 解决了
http://user.qzone.qq.com/19643604/blog/1475133805

Same problem here:

Creating Ionic app in folder /home/sierran/js/mobilestado 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...
Error with start undefined
Error Initializing app: There was an error with the spawned command: npminstall
There was an error with the spawned command: npminstall
Caught exception:
 undefined 

Mind letting us know? https://github.com/driftyco/ionic-cli/issues

node -v
v6.7.0
npm -v
3.10.3
lsb_release -a
No LSB modules are available.
Distributor ID: LinuxMint
Description:    Linux Mint 18 Sarah
Release:    18
Codename:   sarah

Edit: fixed by installing git:

sudo apt-get install git

I wonder if this is anything new as for the ionic and npm. I have node and npm installed as root and doing sudo npm install -g all the time - has something changed in ionic regarding this? if so is this really necessary?

Thanks @sierran, fixed by installing git.

I just followed the node and npm installation here.
https://www.youtube.com/watch?v=AcUfdajsKg8
and for the ionic installation I just followed
https://www.youtube.com/watch?v=geuW_BjR9hE.

Then upon creating my first up using
sudo ionic start myApp tutotial --v2

There was an error with the spawned command: npminstall

Do
sudo apt-get install git
then run again
sudo ionic start myApp tutotial --v2

Linux ubuntu desktop 16.04.01 amd64 via virtual machine
Node 6.7.0
npm 3.10.3

just a BTW note - I've hit exactly same issue (There was an error with the spawned command: npminstall) yet in my case the reason was completely different (which possibly could help someone). I was recently changing the .npmrc to use some private repository and the solution was to just clear the bogus values (or simply remove the .npmrc)

I had the same problem and to resolve needed only update the nodejs.

sudo npm cache clean -f
sudo npm install -g n
sudo n stable

npm 3.10.3
ionic 2.10
node 6.7.0

I'm still getting this error:

Installing npm packages...
Error with start undefined
Error Initializing app: There was an error with the spawned command: npminstall
There was an error with the spawned command: npminstall
Caught exception:
 undefined

I'm running on a windows 10 home x64 :( I tried installing git, but nothing changed!

Same.

npm 3.10.8
ionic 2.1.0
node 6.7.0

Installing npm packages...
Error with start undefined
Error Initializing app: There was an error with the spawned command: npminstall
There was an error with the spawned command: npminstall
Caught exception:
 undefined

macOS Sierra

I have the same problem, but only happens with --v2

D:>ionic start comunidades blank --v2 --ts
Directory already exists: D:\comunidades
Would you like to overwrite the directory with this new project?
(yes/no): yes
yes

Creating Ionic app in folder D:\comunidades based on blank project
Downloading: https://github.com/driftyco/ionic2-app-base/archive/master.zip
[=============================] 100% 0.0s
Downloading: https://github.com/driftyco/ionic2-starter-blank/archive/master.zip
[=============================] 100% 0.0s
Installing npm packages...
Error with start undefined
Error Initializing app: There was an error with the spawned command: npminstall
There was an error with the spawned command: npminstall
Caught exception:
undefined

Mind letting us know? https://github.com/driftyco/ionic-cli/issues

D:>ionic info

Your system information:

Cordova CLI: 6.3.1
Ionic CLI Version: 2.1.0-beta.3
Ionic App Lib Version: 2.1.0-beta.1
OS:
Node Version: v5.12.0

I've the same problem:

E:>ionic start Test --v2
Creating Ionic app in folder E:\Test 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...
Error with start undefined
Error Initializing app: There was an error with the spawned command: npminstall
There was an error with the spawned command: npminstall
Caught exception:
undefined

Mind letting us know? https://github.com/driftyco/ionic-cli/issues

E:>ionic info

Your system information:

Cordova CLI: 6.3.1
Ionic CLI Version: 2.1.0
Ionic App Lib Version: 2.1.0-beta.1
OS:
Node Version: v6.7.0


UPDATE

Solved starting the command prompt with administrator privileges

starting the console as administrator doesn't seem to solve anything for me. I tried to install python on the pc, but it didn't help too :(

Hi i Have the same issue,starting the console as administrator doesn't seem to solve anything for me.

Installing git seems to solve the problem

@Lafaa
Thanks for the info, but please can you tell me which git you installed, as i already have gitbatch installed.

I installed the last version from here https://git-scm.com/downloads !

@Lafaa
Appreciated your help, i confirm that installing git (and selecting for windows command line) fixed the issue for me.

Thanks.

Great! installing Git works for me, thank you very much for your help

please help. i am also getting following error.

my system information:

WINDOWS 7
Cordova CLI: 6.3.1
Ionic CLI Version: 2.1.0
Ionic App Lib Version: 2.0.0-beta.20
OS: Windows 7 SP1
Node Version: v4.5.0

npm version 2.15.9

i am also getting following error,-
[=============================] 100% 0.0s
Installing npm packages...
Error with start undefined
Error Initializing app: There was an error with the spawned command: npminstall
There was an error with the spawned command: npminstall
Caught exception:
undefined

Mind letting us know? https://github.com/driftyco/ionic-cli/issues

i already have git installed and still i am getting above error.

@plnkr2015 did you tried starting the command prompt with administrator privileges

For me, on Mac OS X 10.12 and the following info viasudo ionic info.

Your system information:

Cordova CLI: 6.3.0
Gulp version:  CLI version 1.2.2
Gulp local:
Ionic CLI Version: 2.1.0
Ionic App Lib Version: 2.0.0-beta.20
ios-deploy version: 1.8.6
ios-sim version: 5.0.8
OS: Mac OS X El Capitan
Node Version: v4.6.0
Xcode version: Xcode 8.0 Build version 8A218a

It turns out I created ionic 2 project on folder with group name other than wheel. Thus even executing command via sudo it still show the same error. I then have to do sudo chgrp -R usrname /folder/myfolder (just put your username and folder there). Then it's successfully run without error.

PS. Why OS returns El Capitan instead of Sierra, as I'm on Sierra.

For me it was only to upgrade to new version of npm
npm install -g npm

This is my error log


Cannot download "https://github.com/sass/node-sass/releases/download/v3.10.1/win
32-ia32-46_binding.node":

HTTP error 403 Forbidden

Hint: If github.com is not accessible in your location
try setting a proxy via HTTP_PROXY, e.g.

  export HTTP_PROXY=http://example.com:1234

or configure npm proxy via

  npm config set proxy http://example.com:8080

[email protected] postinstall C:\apps\practice\node_modules\gulp-sass\node_modu
les\node-sass
node scripts/build.js

Building: C:\Program Files\nodejs\node.exe C:\apps\practice\node_modules\gulp-sa
ss\node_modules\node-sass\node_modules\node-gyp\bin\node-gyp.js rebuild --verbos
e --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=

gyp

info it worked if it ends with
ok

gyp
verb cli [ 'C:\Program Files\nodejs\node.exe',
gyp verb cli 'C:\apps\practice\node_modules\gulp-sass\node_modules\node-
sass\node_modules\node-gyp\bin\node-gyp.js',
gyp verb cli 'rebuild',

gyp verb cli '--verbose',
gyp verb cli '--libsass_ext=',
gyp verb cli '--libsass_cflags=',
gyp verb cli '--libsass_ldflags=',
gyp
verb cli '--libsass_library=' ]
gyp info using [email protected]
gyp info
using [email protected] | win32 | ia32

gyp
verb command rebuild []

gyp
verb command clean []

gyp
verb clean removing "build" directory

gyp
verb command configure []

gyp
verb check python checking for Python executable "python2" in the PATH

gyp verb which failed Error: not found: python2
gyp
verb which failed at getNotFoundError (C:\apps\practice\node_modules\gulp
-sass\node_modules\node-sass\node_modules\node-gyp\node_moduleswhichwhich.js:1
4:12)
gyp verb which failed at F (C:\apps\practice\node_modules\gulp-sass\node_m
odules\node-sass\node_modules\node-gyp\node_moduleswhichwhich.js:69:19)
gyp verb which failed at E (C:\apps\practice\node_modules\gulp-sass\node_m
odules\node-sass\node_modules\node-gyp\node_moduleswhichwhich.js:81:29)
gyp verb which failed at C:\apps\practice\node_modules\gulp-sass\node_modu
les\node-sass\node_modules\node-gyp\node_moduleswhichwhich.js:90:16
gyp verb
which failed
at C:\apps\practice\node_modules\gulp-sass\node_modules\node-sass\node_modu
les\node-gyp\node_moduleswhich\node_modules\isexe\index.js:44:5

gyp
verb which failed at C:\apps\practice\node_modules\gulp-sass\node_modules
\node-sass\node_modules\node-gyp\node_moduleswhich\node_modules\isexe\windows.j
s:29:5
gyp
verb which failed at FSReqWrap.oncomplete (fs.js:82:15)
gyp verb which failed python2 { [Error: not found: python2] code: 'ENOENT' }

gyp

verb check python checking for Python executable "python" in the PATH

gyp
verb which failed Error: not found: python
gyp verb which failed at getNotFoundError (C:\apps\practice\node_modules\g
ulp-sass\node_modules\node-sass\node_modules\node-gyp\node_moduleswhichwhich.j
s:14:12)
gyp verb which failed at F (C:\apps\practice\node_modules\gulp-sass\node_m
odules\node-sass\node_modules\node-gyp\node_moduleswhichwhich.js:69:19)
gyp verb which failed at E (C:\apps\practice\node_modules\gulp-sass\node_m
odules\node-sass\node_modules\node-gyp\node_moduleswhichwhich.js:81:29)
gyp verb
which failed at C:\apps\practice\node_modules\gulp-sass\node_modules\node
-sass\node_modules\node-gyp\node_moduleswhichwhich.js:90:16
gyp verb which failed at C:\apps\practice\node_modules\gulp-sass\node_modu
les\node-sass\node_modules\node-gyp\node_moduleswhich\node_modules\isexe\index.
js:44:5
gyp verb which failed at C:\apps\practice\node_modules\gulp-sass\node_modu
les\node-sass\node_modules\node-gyp\node_moduleswhich\node_modules\isexe\window
s.js:29:5
gyp verb which failed at FSReqWrap.oncomplete (fs.js:82:15)
gyp verb which failed python { [Error: not found: python] code: 'ENOENT' }

gyp verb could not find "python". checking python launcher

gyp
verb could not find "python". guessing location
gyp verb ensuring that file exists: C:\Python27\python.exe

gyp
ERR! configure error

gyp ERR! stack Error: Can't find Python executable "python", you can set the PYT
HON env variable.

gyp ERR! stack at failNoPython (C:\apps\practice\node_modules\gulp-sass\node
_modules\node-sass\node_modules\node-gyp\lib\configure.js:449:14)
gyp ERR! stack at C:\apps\practice\node_modules\gulp-sass\node_modules\node-
sass\node_modules\node-gyp\lib\configure.js:404:11
gyp ERR!
stack at C:\apps\practice\node_modules\gulp-sass\node_modules\node-sass\node
_modules\node-gyp\node_modules\graceful-fs\polyfills.js:264:29
gyp
ERR! stack at FSReqWrap.oncomplete (fs.js:82:15)
gyp ERR!
System Windows_NT 6.1.7600

gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\apps\practice\node
_modules\gulp-sass\node_modules\node-sass\node_modules\node-gyp\bin\node-
gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ld
flags=" "--libsass_library="
gyp ERR! cwd C:\apps\practice\node_modules\gulp-sass\node_modules\node-sass
gyp ERR! node -v v4.5.0
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok

Build failed

npm
ERR! Windows_NT 6.1.7600
npm ERR!
argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_mod
ules\npm\bin\npm-cli.js" "install"
npm ERR! node v4.5.0

npm ERR! npm v2.15.9
npm ERR! code ELIFECYCLE

npm ERR! [email protected] postinstall: node scripts/build.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'node scripts/build.j
s'.
npm ERR! This is most likely a problem with the node-sass package,
npm
ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node scripts/build.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs node-sass
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!

npm ERR! npm owner ls node-sass
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! C:\apps\practice\npm-debug.log

Spawn command completed
Error with start undefined
Error Initializing app: There was an error with the spawned command: npminstall
There was an error with the spawned command: npminstall
Caught exception:
undefined

Mind letting us know? https://github.com/driftyco/ionic-cli/issues

@intheb0x do you have python installed? One of the errors seems to be it being unable to find the python executable on your system. Additionally, try updating npm.

Run into this problem very offen, at last, remove totally the .nvm dir, then reinstall nvm, node, ionic, cordova. Then run 'ionic start xxx --v2', will be ok.

Running into this again. Previously it was on a Mac, now on PC.

Sorry - it was npm - for some reason - reverting to an older version.

G:> ionic start piaD sidemenu --v2
Creating Ionic app in folder G:\piaD based on sidemenu project
Downloading: https://github.com/driftyco/ionic2-app-base/archive/master.zip
[=============================] 100% 0.0s
Downloading: https://github.com/driftyco/ionic2-starter-sidemenu/archive/master.zip
[=============================] 100% 0.0s
Installing npm packages...
npm WARN peerDependencies The peer dependency @angular/tsc-wrapped@* included from @ionic/app-scripts will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency rxjs@* included from @ionic/app-scripts will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN optional dep failed, continuing [email protected]
/

[email protected] install G:\piaD\node_modules\@ionic\app-scripts\node_modules\node-sass
node scripts/install.js

Cached binary found at C:Users\HP\AppData\Roaming\npm-cache\node-sass\4.5.0\win32-ia32-46_binding.node

[email protected] postinstall G:\piaD\node_modules\@ionic\app-scripts\node_modules\node-sass
node scripts/build.js

Binary found at G:\piaD\node_modules\@ionic\app-scripts\node_modules\node-sass\vendor\win32-ia32-46\binding.node
Testing binary
Binary is fine
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\Program Files (x86)\nodejs\node.exe" "C:\Program Files (x86)\nodejs\node_modules\npm\bin\npm-cli.js" "install"
npm ERR! node v4.4.1
npm ERR! npm v2.14.20
npm ERR! code EPEERINVALID

npm ERR! peerinvalid The package [email protected] does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer @angular/[email protected] wants [email protected]

npm ERR! Please include the following file with any support request:
npm ERR! G:\piaD\npm-debug.log
Error with start undefined
Error Initializing app: There was an error with the spawned command: npminstall
There was an error with the spawned command: npminstall

After hours of research I finally got it working by installing node-sass globally.

Upgrading npm solve it for me.

None of these solutions work for me. I ran command line as administrator. I cleared the npm cache. I upgraded npm. I installed node-sass globally. I re-installed git, re-installed nodejs, cordova and ionic. Still the same error. It appears ionic does not work on my OS/platform combination (Win10/AMDx64). I'm new to ionic and it looks good on the website, but not being able to generate a simple app is not a confidence builder. I'm really hoping there is a simple fix to this.

npm: 4.4.4
node: 6.10.1
OS: Windows 10 64bit AMD
cordova: 6.5.0
ionic: 2.2.2
git: version 2.12.2.windows.1

The command ionic start glg2 tabs --v2 --verbose produces the following output:

Task: title=start, name=start, summary=Starts a new Ionic project in the specified PATH, [options]=any flags for the command, =directory for the new 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 config, ex: com.mycompany.myapp, title=Skip npm package installation, boolean=true, title=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, --template|-t=Project starter template, boolean=true, title=Start a Ionic v2 project, --zip-file|-z=URL to download zipfile for starter template, isProjectTask=false, run=function run(ionic, argv) {
if (argv.list || argv.l) {
return templateUtils.listTemplates();
}

if (argv._.length < 2 && StartWizard) {
return StartWizard.start();
} else if(argv._length < 2) {
return appLibUtils.fail('Invalid command', 'start');
}

if (argv._[1] === '.') {
return log.error(chalk.red('Please name your Ionic project something meaningful other than \'.\''));
}

// Ensure that the folder name provided is a String
// ie 5 becomes '5' AND '5' stays as '5'
argv._[1] = argv._[1].toString();

var promptPromise;
var options = appLibUtils.preprocessCliOptions(argv);
var startingApp = true;

// Grab the app's relative directory name
if (fs.existsSync(options.targetPath)) {
promptPromise = Start.promptForOverwrite(options.targetPath);
} else {
promptPromise = Q(true);
}

return promptPromise
.then(function(promptToContinue) {
if (!promptToContinue) {
startingApp = false;
log.info('\nIonic start cancelled by user.');
return;
}
return Start.startApp(options);
})
.then(function() {
if (startingApp) {
return Start.printQuickHelp(options);
}
})
.then(function() {
if (startingApp) {
return Start.promptLogin(options);
}
})
.then(function() {
if (options.v2 && startingApp) {
//log.info('\nNew to Ionic? Get started here: http://ionicframework.com/getting-started\n');
}
})
.catch(function(error) {
log.error(error);
throw error;
});
}
Utils.preprocessCliOptions _=[start, glg2, tabs], skip-npm=false, no-cordova=false, w=false, sass=false, s=false, list=false, l=false, v2=true, v=false, verbose=true, $0=C:\Program Files\nodejs\node.exe C:Users\Mike\AppData\Roaming\npm\node_modules\ionic\bin\ionic
Creating an Ionic 2.x app in C:Users\Mike\Documents\Projects\GolfLeaguesAndGames\glg2 based on the tabs template.

Downloading: https://github.com/driftyco/ionic2-app-base/archive/master.zip
Downloading: https://github.com/driftyco/ionic2-starter-tabs/archive/master.zip
Installing npm packages (may take a minute or two)...
Running exec command: npminstall
Spawn command completed
Error with start undefined
Error Initializing app: There was an error with the spawned command: npminstall
There was an error with the spawned command: npminstall

Not a lot of info, even with verbose enabled.

Same here, none of these solutions work for me either. Ionic looked fairly promising but I've had so much trouble trying to get anything to work I've now reluctantly given up with it and am looking at alternatives. Shame really.

@KerryRitter

i have same issues with ionic2 and my error are below please help me and i am using windows 10 with git bash command.

**$ ionic start DemoION2 blank --v2
Creating an Ionic 2.x app in C:Users\Android\DemoION2 based on the blank template.

Downloading: https://github.com/driftyco/ionic2-app-base/archive/master.zip
Downloading: https://github.com/driftyco/ionic2-starter-blank/archive/master.zip
Installing npm packages (may take a minute or two)...
Error with start undefined
Error Initializing app: There was an error with the spawned command: npminstall
There was an error with the spawned command: npminstall**

Android@PC-165 MINGW64 ~
$ **ionic info

Your system information:

Cordova CLI: 6.5.0
Ionic CLI Version: 2.2.2
Ionic App Lib Version: 2.2.1
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v7.8.0
Xcode version: Not installed**

@brandyscarney
Hello brandyscarney ,
I am new in ionic 2 framework to create ionic blank project. but i am getting below error everytime please help me and i am using windows 10 operating system.please help me

I have installed following set up file for ionic project :

C:\ionic>npm -v
4.4.4
C:\ionic>node -v
v7.8.0
C:\ionic>ionic -v
2.2.2
C:\ionic>cordova -v
6.5.0

Error:

C:\ionic>ionic start Ionic2FirstApp blank --v2
Creating an Ionic 2.x app in C:\ionic\Ionic2FirstApp based on the blank template.
Downloading: https://github.com/driftyco/ionic2-app-base/archive/master.zip
Downloading: https://github.com/driftyco/ionic2-starter-blank/archive/master.zip
Installing npm packages (may take a minute or two)...
Error with start undefined
Error Initializing app: There was an error with the spawned command: npminstall
There was an error with the spawned command: npminstall

Your system information:

cordova CLI: 6.5.0
Ionic CLI Version: 2.2.2
Ionic App Lib Version: 2.2.1
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v7.8.0
Xcode version: Not installed

@maibia

Please use following steps it's working perfect.

C:Users\Android>node -v

v7.8.0

C:Users\Android>java -version

java version "1.8.0_91"

Java(TM) SE Runtime Environment (build 1.8.0_91-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.91-b15, mixed mode)

C:Users\Android>node -v

v7.8.0

C:Users\Android>npm install -g cordova

C:Users\Android>npm install -g ionic

C:\ionic>ionic start Project_Name blank --v2 --skip-npm

C:\ionic>npm install -g cnpm --registry=https://registry.npm.taobao.org

C:\ionic>cd Project_Name

C:\ionic\Project_Name >ionic platform add android

if anyone still needs this. here is what worked for me on --v2:

ionic start stripe-payments tabs --type ionic-angular

For me it was only to upgrade to new version of npm
npm install -g npm

Was this page helpful?
0 / 5 - 0 ratings