0

I developed a ionic2 application, I pushed it to a private git repo accessible by our team. When another colleague is downloading this project, he is not able to use the ionic/cordova commands. (he has ionic/cordova installed globally so it's not this problem, I even tried on my machine by creating another repo and didn't work)

Error: Current working directory is not a Cordova-based project.

I know that ionic start/cordova create adds something more than what is uploaded to git, but this commands come with a .gitignore file that will ignore those files.

Is there any way to initiate the ionic application having the code from the private git?

I saw that ionic cli has a command: ionic start --template (which specifies a template) - Starter templates can either come from a named template, (ex: tabs, sidemenu, blank), a Github repo, a Codepen url, or a local directory.

This doesn't work as expected or I am not trying the right way.

Did anyone have the same problem and got a solution?

Alex
  • 166
  • 8

2 Answers2

1

Try creating a www folder in your root directory, then run your build command.

If that works just add the www folder to your git repo by placing a .gitkeep file in it.

Andreas Gassmann
  • 6,334
  • 7
  • 32
  • 45
  • I knew about this solution tried this yesterday and didn't work but today I built everything again like you said and it works great. Thank you for your help! – Alex Mar 17 '17 at 08:23
0

I found that there is no need to create the www folder and to put it on github.

The steps for cloning the Ionic2 application from a git repo are the following:

  1. Git Clone
  2. npm install
  3. ionic build (which will create the www folder and the build structure inside it)
  4. ionic platform add <platform>
  5. ionic build <platform>

It worked for myself, without changing the ionic2 .gitignore or to have a www with .gitkeep as Andreas suggested (which is actually one of the solutions).

Alex
  • 166
  • 8