ionic-cli icon indicating copy to clipboard operation
ionic-cli copied to clipboard

Current working directory is not a Cordova based project

Open jgw96 opened this issue 10 years ago • 49 comments

From @reynoldbhatia on April 14, 2016 20:16

I have everything setup but when I try running ionic platform add android

it just gives me an error saying Current working directory is not a Cordova based project

image

Copied from original issue: driftyco/ionic#6174

jgw96 avatar Apr 15 '16 15:04 jgw96

From @dhirajb1989 on April 15, 2016 2:11

Is config.xml present there???

jgw96 avatar Apr 15 '16 15:04 jgw96

From @reynoldbhatia on April 15, 2016 13:58

Yes there is.

jgw96 avatar Apr 15 '16 15:04 jgw96

@reynoldbhatia Hello! Sorry your having an issue getting started with your ionic app! Did you create this app with ionic start or did you git clone it from github? Also, do you have cordova installed?

jgw96 avatar Apr 15 '16 15:04 jgw96

From @reynoldbhatia on April 15, 2016 15:28

I created it using ionic start. And yes, I have Cordova installed. Cordova create also works. The project created with Cordova create also gives the same error when I try adding the platform.

jgw96 avatar Apr 15 '16 15:04 jgw96

@reynoldbhatia thanks for the info! So im gonna defer this issue over to the ionic-cli repo as the guys over there will be able to help you better with this issue than i can.

jgw96 avatar Apr 15 '16 15:04 jgw96

Could you post the output of ionic info please?

tlancina avatar Apr 16 '16 16:04 tlancina

I am re-installing everything. I'll send it once it is done. Thanks.

reynoldbhatia avatar Apr 19 '16 14:04 reynoldbhatia

capture

The output to ionic info @tlancina

reynoldbhatia avatar Apr 19 '16 15:04 reynoldbhatia

Also, If I run cordova platform add android from inside the project folder, it works fine. But ionic platform add android gives the same error.

reynoldbhatia avatar Apr 19 '16 15:04 reynoldbhatia

Could you run it with the --verbose flag and post the out put please? ionic platform add android --verbose, thanks!

On Tue, Apr 19, 2016 at 10:20 AM Reynold Bhatia [email protected] wrote:

Also, If I run cordova platform add android from inside the project folder, it works fine. But ionic platform add android gives the same error.

— You are receiving this because you were mentioned.

Reply to this email directly or view it on GitHub https://github.com/driftyco/ionic-cli/issues/935#issuecomment-211975724

tlancina avatar Apr 19 '16 15:04 tlancina

capture

reynoldbhatia avatar Apr 19 '16 15:04 reynoldbhatia

I would like to add.... I have 2 other systems running on Windows 8.1 and Windows 10 which work fine. The system I am working on currently is Windows 7. Just in case, if the operating system needs something more to be done while setup.

reynoldbhatia avatar Apr 19 '16 17:04 reynoldbhatia

@reynoldbhatia what version of npm are you using? npm 2 or npm 3?

jgw96 avatar Apr 19 '16 18:04 jgw96

2.15.1

reynoldbhatia avatar Apr 19 '16 18:04 reynoldbhatia

Ahh, could you try updating to npm 3? We've seen a couple of issues related to npm 2. To update npm you run npm install -g npm.

jgw96 avatar Apr 19 '16 18:04 jgw96

Oh and then remove your node modules and then run npm install again.

jgw96 avatar Apr 19 '16 18:04 jgw96

I did as you said. It did not work. Still giving me the same error.

reynoldbhatia avatar Apr 19 '16 19:04 reynoldbhatia

capture

Still getting the same error.

reynoldbhatia avatar Apr 19 '16 19:04 reynoldbhatia

For posterity: usually the solution is to make sure there's a www/ directory inside the root directory.

sbesselsen avatar Aug 01 '16 12:08 sbesselsen

mkdir www in your project folder and it works well.

hoodaajay99 avatar Oct 13 '16 12:10 hoodaajay99