ts-node is giving me this error:
Cannot find module 'process' or its corresponding type declarations.
This is my tsconfig.json
{
"compilerOptions": {
"types": [ "node "],
"declaration": true,
"target": "ESNext",
"module": "CommonJS",
"outDir": "./dist",
"rootDir": "./src",
"moduleResolution": "node"
}
}
This is my package.json
{
"name": "example",
"version": "1.0.0",
"description": "",
"main": "index.js",
"author": "Seph Reed",
"license": "ISC",
"devDependencies": {
"@types/node": "^14.14.9",
"ts-node": "^9.0.0",
"typescript": "^4.1.2"
}
}
Why am I getting this error?
So dumb. There's a space in
"types": [ "node "],
above.Also, you only get the error I listed if you import like this:
If you just use the variable without an import statement, you get the error:
I'm going to leave this question un-deleted for searchability sake. I really couldn't find this error listed anywhere else.