Daveus
Daveus

Reputation: 121

Ionic start give error: There was an error with the spawned command: npminstall

I'm trying to create a mobile app with ionic and cordova but when I launch the comand

ionic start {{appname}} blank 

after the download npm give me

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

I can see that the download is completed because I can see the generated folders. I followed all the suggest I found on the web like update node and npm but nothing works. Here are the version of npm, node, cordova and ionic

Other little warning: I don't know why after all the upgrade when i launch

ionic -v

I've got this:

******************************************************
 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`

******************************************************
2.2.1

even if the cordova version is > 4.2.0 but I really don't think that this is the primary problem. Any ideas?

EDIT: I'm working on windows 7

Upvotes: 3

Views: 2825

Answers (3)

Bryan zhang
Bryan zhang

Reputation: 1

I figured how to solve the dependency warning problem

cordova -v

and then you get a question like :

May Cordova anonymously report usage statistics to improve the tool over time?

say yes.then fixed warning problem. then install npm globally

npm install -g npm 

create a app without installing its packages

ionic start app --v2 --skip-npm

seems ok till now?then

cd app

install packages

npm install --save

done!try to start your ionic app

ionic serve

Upvotes: 0

Daveus
Daveus

Reputation: 121

I found the solution! I tried to lunch the command

ionic start app blank --verbose

and as before it stopped at npminstall. The problem were that verbose doesn't told me the real problem. I moved inside the folder downloaded by Ionic and I launch

npm install --verbose

and here he told me that the problem were the https proxy configuration. So if the error gave by Ionic is just

There was an error with the spawned command: npminstall

just go inside the downloaded folder and launch

npm install --verbose 

for check the real problem

Upvotes: 1

Utkarsh Dubey
Utkarsh Dubey

Reputation: 776

  1. Uninstall all (ionic, cordova, nodejs).
  2. Install nodejs LTS version using this URL - https://nodejs.org/en/
  3. Install ionic and cordova using this URL - https://ionicframework.com/docs/v2/intro/installation/
  4. Also Reinstall Git and when it asks Adjusting your PATH environment select Use Git from the Windows Command Prompt.
  5. When You install ionic and cordova open cmd as admin.
  6. Then Run command in ionic start myApp blank --v2

Upvotes: 0

Related Questions