First configure your package.js file and set the type to module: "type":"module"; then install the package, import the package by writing something like import "method" from "package";(e.g: import {input} from "inquirer")after writing the code run it, I hope it'll work for you.