1

When i am running this code Error cordova plugin add cordova-plugin-customurlscheme --variable URL_SCHEME=ptw in cmd ,i am getting error "Error: Current working directory is not a Cordova-based project." Why this error is coming.I am unable to fix it.Here is the

https://i.stack.imgur.com/nmb0W.png Please suggest me.Thank you in advance.

sradha
  • 2,216
  • 1
  • 28
  • 48
  • please check the result of ls command – Santosh Shinde Jan 27 '16 at 09:19
  • if you got the file like bower.json gulpfile.js plugins www config.xml hooks package.json scss – Santosh Shinde Jan 27 '16 at 09:21
  • You have to be in a project before you launch – Santosh Shinde Jan 27 '16 at 09:26
  • Not understood @Santosh Shinde – sradha Jan 27 '16 at 09:27
  • please let me know the result of ls or dir command – Santosh Shinde Jan 27 '16 at 09:28
  • PS D:\> plugman config ls ; cli configs cache = "C:\\Users\\Sradhanjali\\.plugman\\cache" cache-min = 86400 registry = "http://localhost/PTWAPP/app/_rewrite" user-agent = "npm/2.14.16 node/v4.2.4 win32 ia32" userconfig = "C:\\Users\\Sradhanjali\\.plugman\\config" ; userconfig C:\Users\Sradhanjali\.plugman\config registry = "http://localhost/PTWAPP/app/_rewrite" ; node bin location = C:\Program Files\nodejs\node.exe ; cwd = D:\ ; HOME = C:\Users\Sradhanjali ; 'npm config ls -l' to show all defaults. done – sradha Jan 27 '16 at 09:32
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/101757/discussion-between-santosh-shinde-and-srd). – Santosh Shinde Jan 27 '16 at 09:33

3 Answers3

4

You have to be in a project before you launch

  • Has a .cordova directory, with a config.json inside.
  • Has a www directory, with a config.xml inside.
  • Has a platforms directory.

If all is well then update your cordova

npm install -g cordova

Hopes this will help you !

Santosh Shinde
  • 6,045
  • 7
  • 44
  • 68
1

If you are working on Ionic 2 (this also use cordova) then just follow this link-

Cordova - Current working directory is not a Cordova-based project

Hope it will work !!

Community
  • 1
  • 1
S.Yadav
  • 4,273
  • 3
  • 37
  • 44
0

Working in my case npm install @awesome-cordova-plugins/plugin-name

Swati
  • 234
  • 2
  • 10