Skip to content

CLI invalid options trigger an hard-to-understand stacktrace #198

@f18m

Description

@f18m

Hi all,
I'm trying to use asciidoctor (on top of npm) to produce HTML documentation.
Working on RHEL I managed to install successfully:

npm install -g asciidoctor

but then launching the tool I get the following error:

[root@fedora libzmq-f18m]# asciidoctor -D /tmp/mytest -azmq_version='4.3.6' doc/*.adoc
require 
backend undefined
doctype undefined
standalone false
section-numbers false
failure-level FATAL
quiet true
verbose true
timings false
trace false
base-dir undefined
destination-dir /tmp/mytest
template-dir undefined
template-engine undefined
verbose-mode 0
attributes 
options {"safe":"unsafe","standalone":false,"failure_level":4,"verbose":0,"timings":false,"trace":false,"to_dir":"/tmp/mytest","to_file":"-","attributes":[""]}
node:internal/modules/cjs/loader:1077
  const err = new Error(message);
              ^

Error: Cannot find module ''
Require stack:
- /usr/local/lib/node_modules/asciidoctor/node_modules/@asciidoctor/cli/lib/invoker.js
- /usr/local/lib/node_modules/asciidoctor/node_modules/@asciidoctor/cli/lib/cli.js
- /usr/local/lib/node_modules/asciidoctor/bin/asciidoctor
    at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
    at Function.resolve (node:internal/modules/cjs/helpers:125:19)
    at Invoker.requireLibrary (/usr/local/lib/node_modules/asciidoctor/node_modules/@asciidoctor/cli/lib/invoker.js:126:29)
    at /usr/local/lib/node_modules/asciidoctor/node_modules/@asciidoctor/cli/lib/invoker.js:135:29
    at Array.forEach (<anonymous>)
    at Invoker.prepareProcessor (/usr/local/lib/node_modules/asciidoctor/node_modules/@asciidoctor/cli/lib/invoker.js:134:20)
    at Invoker.invoke (/usr/local/lib/node_modules/asciidoctor/node_modules/@asciidoctor/cli/lib/invoker.js:24:13)
    at Object.<anonymous> (/usr/local/lib/node_modules/asciidoctor/bin/asciidoctor:9:22)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:86:12)
    at node:internal/main/run_main_module:23:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/usr/local/lib/node_modules/asciidoctor/node_modules/@asciidoctor/cli/lib/invoker.js',
    '/usr/local/lib/node_modules/asciidoctor/node_modules/@asciidoctor/cli/lib/cli.js',
    '/usr/local/lib/node_modules/asciidoctor/bin/asciidoctor'
  ]
}

Node.js v18.18.2

I have no clue how to fix it.... any hint?
thanks

PS: I cannot use "dnf install asciidoctor" because actually I'm trying to get Asciidoctor working on readthedocs.io that requires Asciidoctor to be installed through npm

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions