Ionic-framework: Starting a new project issue

Created on 27 Jun 2017  ยท  16Comments  ยท  Source: ionic-team/ionic-framework

Ionic version: (check one with "x")
[ ] 1.x (For Ionic 1.x issues, please use https://github.com/ionic-team/ionic-v1)
[ ] 2.x
[x] 3.x

I'm submitting a ... (check one with "x")
[x] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/

Current behavior:
This error pops out when starting a new project. I didn't touch anything as it was working fine before. Now that I want to start a new project, all of the sudden this error just pops out and I am not the only one.

https://forum.ionicframework.com/t/cant-install-ionic-in-windows/95916
https://forum.ionicframework.com/t/error-when-start-new-project/95878/14

Expected behavior:
I should be able to create a new project without any issues using ionic start projname

Steps to reproduce:

Doing this command
ionic start ionic-multi-module-demo blank

Related code:

Other information:

C:\Users\joaquin.toral\Documents\MyWork>ionic start ionic-multi-module-demo blank
โœ” Creating directory .\ionic-multi-module-demo - done!
[INFO] Fetching app base (https://github.com/ionic-team/ionic2-app-base/archive/master.tar.gz)
โœ” Downloading - done!
[INFO] Fetching starter template blank (https://github.com/ionic-team/ionic2-starter-blank/archive/master.tar.gz)
โœ” Downloading - done!
โœ” Updating package.json with app details - done!
โœ” Creating configuration file ionic.config.json - done!
[INFO] Installing dependencies may take several minutes!
> npm install
โœ– Running command - failed!
[ERROR] An error occurred while running npm install (exit code 1):

        npm WARN deprecated [email protected]: Please update to the latest object-keys
        npm ERR! code 1
        npm ERR! Command failed: C:\Program Files\Git\cmd\git.EXE submodule update -q --init --recursive
        npm ERR! C:\Program Files\Git\mingw64/libexec/git-core\git-submodule: line 7: basename: command not found
        npm ERR! C:\Program Files\Git\mingw64/libexec/git-core\git-submodule: line 7: sed: command not found
        npm ERR! C:\Program Files\Git\mingw64/libexec/git-core\git-submodule: line 19: .: git-sh-setup: file not found
        npm ERR!

        npm ERR! A complete log of this run can be found in:
        npm ERR!     C:\Users\joaquin.toral\AppData\Roaming\npm-cache\_logs\2017-06-27T05_48_11_086Z-debug.log

Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):

@ionic/cli-plugin-proxy : 1.3.1 
@ionic/cli-utils : 1.4.0 
Ionic CLI : 3.4.0 

System: 

Node : v6.11.0 
OS : Windows 7 
Xcode : not installed 
ios-deploy : not installed 
ios-sim : not installed 
npm : 5.0.4

Most helpful comment

I had the same issue on Windows 10, Solution is to run the ionic commands from git Bash. That solved the problem for me.

All 16 comments

I also experience the same thing
Ben@BEN-PC D:\HelloWorldCordova\myApp

ionic serve
? Looks like a fresh checkout! No ./node_modules directory found. Would you like to install project dependencies? Yes
[INFO] Installing dependencies may take several minutes!
npm install
โœ– Running command - failed!
[ERROR] An error occurred while running npm install (exit code 1):

    npm WARN deprecated [email protected]: Please update to the latest object-keys
    npm ERR! code 1
    npm ERR! Command failed: C:\Program Files\Git\cmd\git.EXE submodule update -q --init --recursive
    npm ERR! C:\Program Files\Git\mingw64/libexec/git-core\git-submodule: line 7: basename: command not found
    npm ERR! C:\Program Files\Git\mingw64/libexec/git-core\git-submodule: line 7: sed: command not found
    npm ERR! C:\Program Files\Git\mingw64/libexec/git-core\git-submodule: line 18: .: git-sh-setup: file not found
    npm ERR!

    npm ERR! A complete log of this run can be found in:
    npm ERR!     C:\Users\Ben\AppData\Roaming\npm-cache\_logs\2017-06-27T06_34_28_431Z-debug.log

Same problem here since yesterday. Tried it on different computers on different networks and got the exac same error when creating a new project.

  • Please make sure you have git installed and added to PATH, by running git in command line

Hello all! We are actively looking into this issue. I am setting up the oldest similar issue as a tracking issue and therefore and closing this issue as a duplicate of https://github.com/ionic-team/ionic/issues/12158. Thanks!

@AmitMY I've git installed. Anyway.

  • Are you running this with bash or with windows cmd?
  • Can you please supply the full npm debug log?

Im having this issue also, i have git installed and is accessible on command prompt

Here is what i discovered

First testing is on git bash terminal
issued "ionic start testApp blank"
generation succesful
issued "ionice serve" ---> okay

Second test --> windows command prompt
issued "ionic start testApp2 blank"
generation succesfull
issued "ionic serve" ----> okay

posted also to this one https://forum.ionicframework.com/t/error-when-start-new-project/95878/23

Ive also notice before that the error log is always failing on the cloning of a certain repo
please see this one:
1477 silly resolveWithNewModule [email protected] checking installable status 1478 silly pacote version manifest for [email protected] fetched in 11ms 1479 silly resolveWithNewModule [email protected] checking installable status 1480 silly pacote version manifest for [email protected] fetched in 15ms 1481 silly resolveWithNewModule [email protected] checking installable status **1482 silly fetchPackageMetaData error for bonjour@github:resin-io/bonjour Command failed: C:\Program Files\Git\cmd\git.EXE submodule update -q --init --recursive** 1482 silly fetchPackageMetaData C:\Program Files\Git\mingw64/libexec/git-core\git-submodule: line 7: basename: command not found 1482 silly fetchPackageMetaData C:\Program Files\Git\mingw64/libexec/git-core\git-submodule: line 7: sed: command not found 1482 silly fetchPackageMetaData C:\Program Files\Git\mingw64/libexec/git-core\git-submodule: line 18: .: git-sh-setup: file not found

@ralphskie It's same like mine some ago. @AmitMY you could see this. It's the same anyway
I think the problem is with the mingw or such...
2017-06-28T05_11_36_639Z-debug.log.txt

Hi @joaquintoral,

we can find the clue in the npm error log. I found that in my npm error log.

2175 silly fetchPackageMetaData error for ajv@^4.9.1 Unexpected end of input at 1:19054
2175 silly fetchPackageMetaData tories":{},"dist":{"shasum":"8a6ff37adcf656095096c2f5485ee90a76dbf346
2175 silly fetchPackageMetaData                                                                      ^
2176 verbose stack SyntaxError: Unexpected end of input at 1:19054
2176 verbose stack tories":{},"dist":{"shasum":"8a6ff37adcf656095096c2f5485ee90a76dbf346
2176 verbose stack     

then it solved my issue.

rm -rf ~/.npm-cache
cd ./project-dir/ 
npm install

Newest Ionic 3.6 have no issue, seems they have patch it. So this thread can be closed.

Benyamin Limanto

sent from Windows Live Mail on Windows 7 (Asus A43SV)

From: ihsanberahim
Sent: Monday, August 07, 2017 10:32 AM
To: ionic-team/ionic
Cc: Benyamin Limanto ; Comment
Subject: Re: [ionic-team/ionic] Starting a new project issue (#12165)

Hi @joaquintoral,

we can find the clue in the npm error log. I found that in my npm error log.

2175 silly fetchPackageMetaData error for ajv@^4.9.1 Unexpected end of input at 1:19054
2175 silly fetchPackageMetaData tories":{},"dist":{"shasum":"8a6ff37adcf656095096c2f5485ee90a76dbf346
2175 silly fetchPackageMetaData ^
2176 verbose stack SyntaxError: Unexpected end of input at 1:19054
2176 verbose stack tories":{},"dist":{"shasum":"8a6ff37adcf656095096c2f5485ee90a76dbf346
2176 verbose stack
then it solved my issue.

rm -rf ~/.npm-cache
cd ./project-dir/
npm install
โ€”
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

I had the same issue on Windows 10, Solution is to run the ionic commands from git Bash. That solved the problem for me.

If we try it from Git bash it works fine for me. The other option to get it working from cmd as well is to add your git usr bin folder to Windows Path variable.

@koti-muppavarapu THANK YOU. I swear I have been googling this error and trying so many solutions for the last 2 full days (absolute waste of time).

  • [x] Running the command from git bash worked.
  • [ ] Adding C:\Program Files\Git\usr\bin as environment variable didn't.
> npm -v
    5.6.0

> ionic -v
    3.20.0

> cordova -v
    7.1.0

> git --version
    git version 2.16.2.windows.1

@iamjoyce Thanks for your feedback.

Did you add C:\Program Files\Git\usr\bin to Path Environment Variable? I have added it to Path System Level Environment variable. Obviously, you need to restart your cmd to get this change reflected. If still not working, try adding a backslash (C:\Program Files\Git\usr\bin) at the end of the path mentioned above.

@koti-muppavarapu Yep, I did, still didn't work. Another machine of mine didn't have C:\Program Files\Git\usr\bin in the env path, but the ionic commands still run correctly on windows cmd.

I can't exactly pin-point what's the problem, but your solution works ๐Ÿ‘

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

Was this page helpful?
0 / 5 - 0 ratings