Unable to start new project


#1

Hi,
I need some help, previously start a new project is easy:

ionic start myApp --v2

but now with the following error:

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

Somebody help, thanks in advance.

My system information:

Cordova CLI: 6.5.0
Ionic CLI Version: 2.2.3
Ionic App Lib Version: 2.2.1
ios-deploy version: 1.9.1
ios-sim version: 5.0.13
OS: OS X El Capitan
Node Version: v6.10.2
Xcode version: Xcode 8.2.1 Build version 8C1002

npm 3.10.10


#2

Something is broken with your npm.

I would advise you to uninstall everything (cordova, Ionic CLI, Node) and install nvm and then reinstall a node version you like, then install Cordova and Ionic in there. Your problem will be solved and you will be using current, supported versions of everything.


#3

Hi,
I just do the following update:
sudo npm install npm@latest -g
sudo npm install -g cordova
sudo npm install -g ionic

Everything is okay now, thank you.


#4

Anybody else reading this, please follow @Sujan12’s advice about using nvm and not the previous post recommending running npm as root.


#5

Sorry, just start learning Ionic, I will try do it all over again. Thanks for advice.


#6

Hi,

After following what @Sujan12’s instruction, I am able to start new ionic project now.
But I got some error when I try to generate a keystore for Android.

keytool -genkey -v -keystore my-native-key.keystore -alias My-Native -keyalg RSA -keysize 2048 -validity 10000

Illegal option:  RSA
keytool -genkeypair [OPTION]...
Generates a key pair

Obviously it has something to do with the option -keyalg, I can’t find solution at other places.
Does it has something to do with the nvm?
Please help.

My Environment Information:

global packages:

@ionic/cli-utils : 1.3.0
Cordova CLI      : 7.0.1 
Ionic CLI        : 3.3.0

local packages:

@ionic/app-scripts              : 1.3.7
@ionic/cli-plugin-cordova       : 1.3.0
@ionic/cli-plugin-ionic-angular : 1.3.0
Cordova Platforms               : android 6.2.3 ios 4.4.0
Ionic Framework                 : ionic-angular 3.3.0

System:

Node       : v8.0.0
OS         : OS X El Capitan
Xcode      : Xcode 8.2.1 Build version 8C1002 
ios-deploy : 1.9.1 
ios-sim    : 5.0.13

#7

Try to bind key tool inside the constructor. And don’t put it before any ugly bad declaration in the controller.