Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[kroki-fetch-diagram] cannot find module 'mkdirp' #47

Closed
anb0s opened this issue Apr 20, 2020 · 4 comments · Fixed by #52
Closed

[kroki-fetch-diagram] cannot find module 'mkdirp' #47

anb0s opened this issue Apr 20, 2020 · 4 comments · Fixed by #52

Comments

@anb0s
Copy link
Contributor

anb0s commented Apr 20, 2020

I've installed asciidoctor-kroki in node.js (windows) together with reveal.js. I set the attribute :kroki-fetch-diagram: true to fetch the diagram during convert to have the presentation for offline usage later. I've registered it with own convert-slides.js:

// Load Asciidoctor.js and the reveal.js converter
var asciidoctor = require('@asciidoctor/core')()
var asciidoctorRevealjs = require('@asciidoctor/reveal.js')
asciidoctorRevealjs.register()

// Load asciidoctor-kroki
var kroki = require('asciidoctor-kroki')
kroki.register(asciidoctor.Extensions)

// Convert the document 'presentation.adoc' using the reveal.js converter
var options = { safe: 'unsafe', backend: 'revealjs' }
asciidoctor.convertFile('presentation.adoc', options)

Now it coplains aboud missing dependency

Skipping plantuml block. Cannot find module 'mkdirp'
Require stack:
- d:\Project\docu\node_modules\asciidoctor-kroki\dist\node\node-fs.js
- d:\Project\docu\node_modules\asciidoctor-kroki\dist\node\fetch.js
- d:\Project\docu\node_modules\asciidoctor-kroki\dist\node\asciidoctor-kroki.js
- d:\Project\docu\convert-slides.js
@anb0s
Copy link
Contributor Author

anb0s commented Apr 20, 2020

npm i --save mkdirp solves the issue

@ggrossetie
Copy link
Member

Yes sorry about that the dependency is missing from the package.json I must have forgotten to add --save:

https://github.com/Mogztter/asciidoctor-kroki/blob/bf1f8edf813566f45c2a6c1dea3219853d2c4fbb/src/node-fs.js#L3

I will add the missing dependency and a test on the next release.

@anb0s anb0s changed the title Cannot find module 'mkdirp' [kroki-fetch-diagram] cannot find module 'mkdirp' Apr 20, 2020
@anb0s
Copy link
Contributor Author

anb0s commented Apr 20, 2020

It's not an issue for me, just to inform you. Thanks!

ggrossetie added a commit that referenced this issue Apr 23, 2020
@ggrossetie
Copy link
Member

Actually we had tests on this feature but the mkdirp package was a transitive development dependency so it was working... 😅

ggrossetie added a commit that referenced this issue Apr 24, 2020
resolves #47 add mkdirp as a dependency
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants