The documented createRequire function is available since Node 12 and lets you resolve module on behalf of other modules - which I believe is why you used ncjsm here. Since it's part of the Node API, it's expected to work regardless how the project is installed.
Fixing this (and updating serverless to reference an updated release) fixes #3.
Interestingly, I just noticed that the package I modified locally on my machine was @serverless/utils, not @serverless/inquirer. I suspect those got merged together, and this repo is outdated?
The documented
createRequire
function is available since Node 12 and lets you resolve module on behalf of other modules - which I believe is why you used ncjsm here. Since it's part of the Node API, it's expected to work regardless how the project is installed.Fixing this (and updating
serverless
to reference an updated release) fixes #3.