I don't know why am I getting the following error which say:
Error: Debug Failure. False expression: Non-string value passed to `ts.resolveTypeReferenceDirective`, likely by a wrapping package working with an outdated `resolveTypeReferenceDirectives` signature. This is probably not a problem in TS itself.
When i try to import the package inquirer
in my nodejs application.
console.log("Hello world!");
import inquirer from "inquirer";
....
To run the application I'm using ts-node
and I'm running it as follows:
ts-node index.ts
This is my package.json
file:
{
....
"dependencies": {
"chalk": "^4.1.2",
"cors": "^2.8.5",
"cross-fetch": "2.6.1",
"dotenv": "^16.0.1",
"inquirer": "^8.2.4",
"ts-node": "^10.8.1",
"typescript": "^4.7.3"
},
"devDependencies": {
"@types/chalk": "^2.2.0",
"@types/cors": "^2.8.12",
"@types/inquirer": "^8.2.1",
"@types/node": "^17.0.42",
"nodemon": "^2.0.16",
"ts-node-dev": "^2.0.0"
}
....
}
- I've tried to change the versions of
inquirer
andtypescript
but still it did not work.
What can be possibly the problem.
I have met with the same error but in my case I had no
ts-node
dependency installed, I fixed the error by adding that dependency.You can also try to run your application with
npx
, in your case that will benpx ts-node index.ts
.