-
-
Notifications
You must be signed in to change notification settings - Fork 227
Closed
Description
Invoking the CLI since 0.29.0 results in a runtime error due to the #!/usr/bin/env -S node -r esm shebang. I've reproduced the issues installing globally with npm i -g and installing in a project's node_modules for invocation via via node_modules/.bin/commonmark or npx commonmark.
Relevant Commit: 9bcf45b
I am not up-to-date on Node.js and ESM support, or this package's Node.js version compatibility contract.
I will poke around a bit now and try to see if I can introduce a test for CLI invocation.
$ node -v
v14.15.1
$ npm i -g https://github.com/commonmark/commonmark.js
# 6d80c8eedd09189f089568710dcee5c964dedb37 as of now
[...]
$ commonmark
internal/modules/cjs/loader.js:883
throw err;
^
Error: Cannot find module 'esm'
Require stack:
- internal/preload
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
at Function.Module._load (internal/modules/cjs/loader.js:725:27)
at Module.require (internal/modules/cjs/loader.js:952:19)
at Module._preloadModules (internal/modules/cjs/loader.js:1217:12)
at loadPreloadModules (internal/bootstrap/pre_execution.js:447:5)
at prepareMainThreadExecution (internal/bootstrap/pre_execution.js:75:3)
at internal/main/run_main_module.js:7:1 {
code: 'MODULE_NOT_FOUND',
requireStack: [ 'internal/preload' ]
}
$ npm i -g esm
[...]
$ commonmark
internal/modules/cjs/loader.js:883
throw err;
^
Error: Cannot find module 'esm'
Require stack:
- internal/preload
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
at Function.Module._load (internal/modules/cjs/loader.js:725:27)
at Module.require (internal/modules/cjs/loader.js:952:19)
at Module._preloadModules (internal/modules/cjs/loader.js:1217:12)
at loadPreloadModules (internal/bootstrap/pre_execution.js:447:5)
at prepareMainThreadExecution (internal/bootstrap/pre_execution.js:75:3)
at internal/main/run_main_module.js:7:1 {
code: 'MODULE_NOT_FOUND',
requireStack: [ 'internal/preload' ]
}
Metadata
Metadata
Assignees
Labels
No labels