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


#1
Error:
C:\ionic>ionic start cutePuppyPics --v2
Creating an Ionic 2.x app in C:\ionic\cutePuppyPics 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)...
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 am use following version , but i am not creating ionic 2 project on windows system.
Please help me.

Version:

C:\ionic>npm -v
4.5.0

C:\ionic>ionic -v
2.2.2

C:\ionic>node -v
v7.8.0

C:\ionic>cordova -v
6.5.0

C:\ionic>ionic info

Your system information:

ordova 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


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
Error Initializing app: There was an error with the spawned command: npminstall
#2

Try ionic start cutePuppyPics --v2 --verbose so we get some more error output.


#3

Ok Sujan and thank for the replay.


#4

Hello Sujan ,

I am create ionic 2 project with --Verbose but still i am facing problem to create project .
Please check my below command with Error:

C:\ionic>ionic start cutePuppyPics --v2 --verbose
Task: title=start, name=start, summary=Starts a new Ionic project in the specified PATH, [options]=any flags for the command, <PATH>=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 <widget id> 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, cutePuppyPics], 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\Android\AppData\Roaming\npm\node_modules\ionic\bin\ionic
Directory already exists: C:\ionic\cutePuppyPics
Would you like to overwrite the directory with this new project?
(yes/no): Yes

Creating an Ionic 2.x app in C:\ionic\cutePuppyPics 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

#5

(I edited your post to make the console output readable - use the </> button after pasting the text please.)

I don’t see any error output here. Are you sure the command was finished? Takes quite some time sometimes.


#6

C:\ionic>ionic start cutePuppyPics --v2 --verbose

Task: title=start, name=start, summary=Starts a new Ionic project in the specified PATH, [options]=any flags for the command, <PATH>=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 <widget id> 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, cutePuppyPics], 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\Android\AppData\Roaming\npm\node_modules\ionic\bin\ionic
Directory already exists: C:\ionic\cutePuppyPics
Would you like to overwrite the directory with this new project?
(yes/no): Yes

Creating an Ionic 2.x app in C:\ionic\cutePuppyPics 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


#7

What is exactly what you posted before, again mangled by strange formatting. Making stuff bold doesn’t help.


#8
C:\ionic>ionic start cutePuppyPics --v2 --verbose

Task: title=start, name=start, summary=Starts a new Ionic project in the specified PATH, [options]=any flags for the command, <PATH>=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 <widget id> 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, cutePuppyPics], 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\Android\AppData\Roaming\npm\node_modules\ionic\bin\ionic
Directory already exists: C:\ionic\cutePuppyPics
Would you like to overwrite the directory with this new project?
(yes/no): Yes

Creating an Ionic 2.x app in C:\ionic\cutePuppyPics 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

#9

This looks good :slight_smile: But still no error message. Just normal output of a command not yet finished.


#10

Hello Sujan ,

Please check below error with above code:

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)…
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


#11
**C:\ionic\Pro_Demo>ionic start cutePuppyPics2 --v2 --verbose**

    Task: title=start, name=start, summary=Starts a new Ionic project in the specified PATH, [options]=any flags for the command, <PATH>=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 <widget id> 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, cutePuppyPics2], 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\Android\AppData\Roaming\npm\node_modules\ionic\bin\ionic
    Creating an Ionic 2.x app in C:\ionic\Pro_Demo\cutePuppyPics2 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

    C:\ionic\Pro_Demo>

#12

Ok, now I see the error. --verbose didn’t help at all :confused: Sorry, no idea.


#13

@Sujan12
Without --verbose also getting same error. and i am using windows 10 OS and Ionic 2.
please help me.


#14

Random suggestions:


#15

@Sujan12

Ok Thanks for the help . i will try and let you know if any issues occurring to create new ionic 2 project


#16

@Sujan12

same error occurring. Any other solution for creating ionic 2 project in windows operating system.


#17

You tried both suggested solutions?


#18

@Sujan12
Thank’s Sujan ,Yes i have both option try and try to create new ionic2 project but not created.Please tell me other solution


#19

@Sujan12

I have installed all the version of node-js,ionic 2,cordova and npm.
But still i am getting Error on creating new project from the command prompt.

Please check debug.log PFA

Can you please suggest me which tools are better to create ionic 2 application on windows 10 operating system ?.

and Thank’s for the help.

Debug Log:


#20

@Sujan12
I am getting New Error Please help me to create ionic 2 project.

C:\ionic>ionic start Ion3App blank --v2
:heavy_check_mark: Creating directory C:\ionic\Ion3App - done!
:heavy_check_mark: Downloading ‘blank’ starter template - done!
:heavy_check_mark: Updating project dependencies to add required plugins - done!
:heavy_check_mark: Creating configuration file for the new project - done!
:heavy_multiplication_x: Executing: npm install within the newly created project directory - failed!
npm install failed