After you install the prompt package go to package.json and add "type": "module" right before the keywords, like this:
"type": "module",
"keywords": [],
"author": "",
"license": "ISC",
"description": "",
"dependencies": { "prompt-sync": "^4.2.0"