I'm getting pkg is not defined when attempting to sudo plugman createpackagejson {path of plugin} I can see there's plenty on Github about this issue but no precise directions on work around or how to fix it. Please could someone advise?
4 Answers
I met the same issue when using keymob-plugin.
This issue was fixed with pull request which already merged into master but not published yet,maybe it will be available with the next release of cordova-lib.
For now you can create package.json
manually because the content of package.json
depends on plugin.xml
. You can also read the package.json
in other 3rd plugins and the npm documentation of package.json
.

- 11
- 1
-
Rather ironically, it seems as though you haven't added your package.json file to github, so trying to follow your advice by looking at *your* plugin's package.json ends up as a dead end! ;) – Jules Nov 26 '17 at 00:51
It's not working for me either. I've created it with
npm init
and manually entered the information requested.

- 1,967
- 2
- 21
- 24
This seems to have been fixed. It stopped saying this error when I updated plugman using
npm install plugman
However, then it said another error. It's pretty poor practise that there is no effort towards making plugins backwards compatible.

- 21,218
- 14
- 66
- 75
So apparently this has been addressed, but a fix has not been released, yet. https://github.com/apache/cordova-lib/pull/597 .

- 51
- 1
- 6