MOTZI
MOTZI

Reputation: 115

Cordova plugin installation and package.json

i am new to cordova.

I created a project using the command cordova create hello com.example.helloapp Hello. The Project is created with default folders and files and a package.json.

Then, i wanted to add a simple plugin from git (a hello world plugin for testing) : cordova plugin add https://github.com/don/cordova-plugin-hello.git .

I get an error that the file package.json dosen't exist in the current directory (current directory = where i created my project hello that contains that file as said earlier), i listed the files with dir /o, see screens below : Image Error & Image package.json

What am i doing wrong ? Thanks in advance.

Upvotes: 1

Views: 1929

Answers (2)

sachin khaire
sachin khaire

Reputation: 51

**

Create Custom Plugin

**

  • plugman create —name CustomPlugin --plugin_id com-SA-plugin --plugin_version 0.0.1
    • cd CustomPlugin
    • plugman platform add - -platform_name ios
    • plugman createpackagejson .

**

Create Project

**

  • cordova create CustomPluginApp com.SA.plugin DemoApp
  • cd CustomPluginApp
  • cordova plugin add …/CustomPlugin (plugin path)
  • cordova platform add ios

Upvotes: 1

MOTZI
MOTZI

Reputation: 115

The plugin mentioned is old, IT IS the one who's missing the .JSON file. Found a newer version and it worked.

Upvotes: 0

Related Questions