Tag Archives: Ionic error

[Solved] Ionic error: Error Initializing app: There was an error with the spawned command: npminstall

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

Ionic 2 reports an error when creating a project, as shown above; I tried many methods. NPM, Cordova and ionic all tried to reinstall. But it is still invalid. There is no problem generating ionic1 project when ionic starts, but there is a problem when upgrading ionic2. I think it’s a network problem. It seems that the source of NPM is from abroad. Wait until the net is good

There is now a compromise, as follows:

Solution:

At this time, we can first use the domestic image cnpm. The installation command is:
NPM install – G cnpm
then try cnpm – V to see if there is a version number. If there is, the installation is successful
then the following statement
ionic start app — V2 — skip NPM

 

To explain the above statement, – V2 means to create an app with ionic2 version, – skip NPM means to skip the NPM installl package stage
so there will be no error prompt this time, but the creation is not really completed. We also need to enter the app directory and execute cnpm install — save
once. If there is no error, it means success. At this time, you can use the ionic serve command, See the effect of our app interface on the browser