generator: [BUG] Generator fails with two errors noop.js 'MODULE_NOT_FOUND', and Generation failed##] - reify:rxjs:

Describe the bug.

Generator fails with two errors noop.js ‘MODULE_NOT_FOUND’, and Generation failed##] - reify:rxjs:

docker run --rm -it --user=root \
       --volume ${PWD}/output:/app/output \
       --volume ${PWD}/work_queue.yaml:/app/work_queue.yaml \
       asyncapi/cli generate fromTemplate /app/work_queue.yaml \
       @asyncapi/html-template --use-new-generator --force-write --output /app/output
 
AsyncAPI anonymously tracks command executions to improve the specification and tools, ensuring no sensitive data reaches our servers. It aids in comprehending how AsyncAPI tools are used and adopted, facilitating ongoing improvements to our specifications and tools.

To disable tracking, please run the following command:
  asyncapi config analytics --disable

Once disabled, if you want to enable tracking back again then run:
  asyncapi config analytics --enable

┌  AsyncAPI Generator
Generation in progress. Keep calm and wait a bit
Template is not available locally and expected location is undefined. Known details are: undefined Error: Cannot find module '@asyncapi/html-template/package.json'
Require stack:
- /usr/local/lib/node_modules/noop.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1225:15)
    at Function.Module._resolveFilename.sharedData.moduleResolveFilenameHook.installedValue [as _resolveFilename] (/libraries/node_modules/@cspotcode/source-map-support/source-map-support.js:811:30)
    at resolveFileName (/libraries/node_modules/resolve-from/index.js:29:39)
    at resolveFrom (/libraries/node_modules/resolve-from/index.js:43:9)
    at module.exports (/libraries/node_modules/resolve-from/index.js:46:47)
    at utils.getTemplateDetails (/libraries/node_modules/generator-v2/lib/utils.js:192:30)
    at Generator.installTemplate (/libraries/node_modules/generator-v2/lib/generator.js:564:24)
    at Generator.installAndSetupTemplate (/libraries/node_modules/generator-v2/lib/generator.js:285:73)
    at Generator.generate (/libraries/node_modules/generator-v2/lib/generator.js:198:16)
    at async Generator.generateFromString (/libraries/node_modules/generator-v2/lib/generator.js:446:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/usr/local/lib/node_modules/noop.js' ]
}
Template installation started because the template cannot be found on disk.
Using npm registry https://registry.npmjs.org and authorization type anonymous to handle template installation.
Generation failed##] - reify:rxjs:
Generator Error: Installation failed

Expected behavior

Should create output with all HTML content

Screenshots

Image

How to Reproduce

Get any AsyncAPI document and run the following Docker command (Adjust paths according to your environment)

docker run --rm -it --user=root \
       --volume ${PWD}/output:/app/output \
       --volume ${PWD}/work_queue.yaml:/app/work_queue.yaml \
       asyncapi/cli generate fromTemplate /app/work_queue.yaml \
       @asyncapi/html-template --use-new-generator --force-write --output /app/output

🖥️ Device Information [optional]

  • Operating System (OS):
  • Browser:
  • Browser Version:

👀 Have you checked for similar open issues?

  • I checked and didn’t find similar issue

🏢 Have you read the Contributing Guidelines?

Are you willing to work on this issue ?

None

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (5 by maintainers)

Most upvoted comments

in logs this is what indicates successful template fetch and usage:

Using npm registry https://registry.npmjs.org and authorization type anonymous to handle template installation.
Template @asyncapi/html-template successfully installed in /libraries/node_modules/generator-v2/node_modules/@asyncapi/html-template.
Version of used template is 3.0.0.

the error Generation failed##] - reify:rxjs: is related to the dependency that generator uses to install packages.

so there may be 2 different issues, the most common:

  • either permissions
  • network, blocking access to npm

so as I wrote there in the previous comment, try running docker by first installing @asyncapi/html-template separately, before running asyncapi generate. So basically run npm install @asyncapi/html-template