cdwv / oas3-api-snippet-enricher

Enrich your OpenAPI 3.0 JSON with code samples
MIT License
90 stars 13 forks source link

Require(...) is not a function #7

Closed RolphH closed 4 years ago

RolphH commented 4 years ago

When (as documented) running ./node_modules/.bin/snippet-enricher-cli --input=.... there is an error:

require('./../index.js')(); ^ TypeError: require(...) is not a function

Removing the () from the require fixed this issue.

andrzejwp commented 4 years ago

@RolphH can you please open a PR for this?

thblckjkr commented 4 years ago

I have the same problem, to solve it i tried to use any of the older versions (0.3 - 0.5) and it didn't work.

I guess has something to do with my node version v14.3.0 but i am not really sure.

I solved it with a script in my project repo, containing the following code, to solve the problem without modifying the code in node_modules

#!/usr/bin/env node
require('../node_modules/snippet-enricher-cli/index');