Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

No such built-in module "readline/promises"

I’m having problems using readline, every time I get the error No such built-in module: node:readline/promises. However according to Readline’s own doc I would only need this part https://nodejs.org/api/readline.html

import * as readline from 'node:readline/promises';
import { stdin as input, stdout as output } from 'node:process';

const rl = readline.createInterface({ input, output });

Image of the package.json

Image of the error

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I’m sorry if this is a question that has already been answered before, but I couldn’t find anything that would help me.

>Solution :

This may be dependent on which version of node you’re running. Different versions have different ways of importing built in modules. If you don’t know which version you’re on, run node -v on the console, the go to the node readline documentation here, go to Other Versions at the top and select your node version.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading