Open krodyrobi opened 6 years ago
Thank you for reporting this. It’s weird. I have problems reproducing this error, but you’re not the first one to encounter it. Can you tell me something more about your system configuration and where and how you’ve installed raml2html and raml2html-werk-theme? Is there any other output before this error?
I’ve tried this with: Arch Linux: node==10.5.0, npm==6.1.0 Debian Stretch: node==8.11.3, npm==5.6.0
And just to be sure we’re using the exact same versions, could you:
npm install && npm run build
inside the test-raml directory?Weirdly enough installed locally it works.
Running a windows 10 machine and installed the theme and raml2html globally.
npm list -g --depth 0
+-- @angular/cli@6.0.0
+-- api-designer@0.4.1
+-- npm@6.1.0
+-- raml2html@7.1.0
+-- raml2html-werk-theme@1.0.3
+-- request@2.87.0
`-- typescript@2.8.1
npm list -g --depth 1
+-- raml2html@7.1.0
| +-- marked@0.3.12
| +-- minimize@2.1.0
| +-- nunjucks@2.5.2
| +-- nunjucks-markdown@2.0.1
| +-- pretty@2.0.0
| +-- raml2html-default-theme@2.8.0
| +-- raml2obj@6.0.0
| `-- yargs@10.1.2
+-- raml2html-werk-theme@1.0.3
| +-- bulma@0.6.2
| +-- delegate@3.2.0
| +-- details-element-polyfill@2.0.1
| +-- fs-extra@5.0.0
| +-- highlight.js@9.12.0
| +-- html-minifier@3.5.18
| +-- luett@2.6.0
| +-- markdown-it@8.4.1
| +-- markdown-it-deflist@2.0.3
| +-- markdown-it-sanitizer@0.4.3
| +-- open-color@1.6.3
| `-- stroll.js@3.0.3
Ok. So the deciding fact seems to be that you’ve installed it globally. I have no idea why that would change anything, but I’ll look into it. As you’ve already figured out the work-around seems to be installing raml2html and the theme locally.
The issue is most probably caused by the missing dependency on nunjucks. This is a stacktrace I'm getting after digging a little deeper:
Error: Cannot find module 'nunjucks'
Require stack:
- ...\npm\node_modules\raml2html-werk-theme\config.js
- ...\npm\node_modules\raml2html\index.js
- ...\npm\node_modules\raml2html\bin\raml2html
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:625:15)
at Function.Module._load (internal/modules/cjs/loader.js:527:27)
at Module.require (internal/modules/cjs/loader.js:683:19)
at require (internal/modules/cjs/helpers.js:16:16)
at Object.<anonymous> (...\npm\node_modules\raml2html-werk-theme\config.js:5:18)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:643:32)
at Function.Module._load (internal/modules/cjs/loader.js:556:12)
at Module.require (internal/modules/cjs/loader.js:683:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'...\\npm\\node_modules\\raml2html-werk-theme\\config.js',
'...\\npm\\node_modules\\raml2html\\index.js',
'...\\npm\\node_modules\\raml2html\\bin\\raml2html'
]
Based on @GauntletPL comment, I installed nunjucks package globally and the theme worked and the error was gone.
error message
versions node: 8.11.3 npm: 6.1.0 raml2html: 7.1.0 raml2html-werk-theme: 1.0.3
api.raml
It errors the same way even for an almost empty raml file.
command