gitbook-plugin-prism icon indicating copy to clipboard operation
gitbook-plugin-prism copied to clipboard

Error: HonKit doesn't satisfy the requirements of this plugin: gitbook-plugin-prism require <5.0.0

Open mziyut opened this issue 3 years ago • 2 comments

Note I understand that this plugin was create for GitBook, so if there is no room for discussion, please close

I'm using this plugin in HonKit forked from GitBook. HonKit recently released v4.0.0 and this plugin does not work with the latest HonKit

Honkit requires a gitbook or honkit description in the engines description, with the gitbook definition taking precedence

https://github.com/honkit/honkit/blob/32e906fc392accc23940e99e284efea005398544/packages/honkit/src/plugins/validatePlugin.ts#L18-L19

The engines definition of gitbook-plugin-prism is not intended for use with v4.0.0, so you will get an error if you try to use this plugin with Honkit

https://github.com/gaearon/gitbook-plugin-prism/blob/34f434cbec867413ad9ae3c4302049318873d00a/package.json#L10-L12

% node -v
v18.4.0
% honkit -V
4.0.0
% honkit build
...
Error: HonKit doesn't satisfy the requirements of this plugin: gitbook-plugin-prism require <5.0.0
    at validatePlugin (/path-to-honkit/node_modules/honkit/lib/plugins/validatePlugin.js:29:41)
    at /path-to-honkit/node_modules/honkit/lib/plugins/loadPlugin.js:81:56
    at _fulfilled (/path-to-honkit/node_modules/q/q.js:854:54)
    at /path-to-honkit/node_modules/q/q.js:883:30
    at Promise.promise.promiseDispatch (/path-to-honkit/node_modules/q/q.js:816:13)
    at /path-to-honkit/node_modules/q/q.js:570:49
    at runSingle (/path-to-honkit/node_modules/q/q.js:137:13)
    at flush (/path-to-honkit/node_modules/q/q.js:125:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:77:11)

I'm considering the following options. I would like to hear opinions.

  • Remove <4.0.0 from the engine definition
  • Fork this repository and create a new honkit-plugin-prism.

Please let me know if there is a better way other than the above. I'm prepared to create a pull request to resolve this issue.

mziyut avatar Sep 28 '22 11:09 mziyut

similar issue: Error: HonKit doesn't satisfy the requirements of this plugin: gitbook-plugin-prism require >=2.4.1 <4.0.0

my option: prefer second one honkit-plugin-prism

crifan avatar May 27 '23 23:05 crifan

I created honkit-plugin-prism by forking in order to solve this problem quickly. I have also published it on npm.

https://github.com/mziyut/honkit-plugin-prism https://www.npmjs.com/package/honkit-plugin-prism

I'm not sure if it will be helpful to you.

mziyut avatar May 28 '23 09:05 mziyut