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

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

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 4
  • Comments: 60 (8 by maintainers)

Most upvoted comments

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

@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™ SE Runtime Environment (build 1.8.0_91-b15) Java HotSpot™ 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

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

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.

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

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

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

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