Hello. I'm learning typescript, and when I transpiled the code with npx tsc index.ts it threw 10 errors, however, it still transpiled the file.
I tried moving the folder to a new location to see if tsc is in conflict with any react file I have in there, I left the ts file empty and I get the same error, I reinstalled typescript; but nothing seems to work
typescript code:
const greeting: string = "Hello world";
console.log(greeting);
package.json:
{
"name": "learningtsc",
"version": "1.0.0",
"main": "index.js",
"author": "ema4hhh",
"license": "MIT",
"dependencies": {
"typescript": "^4.9.4"
},
"scripts": {
"start": "node index.js",
"build": "tsc index.ts",
"watch": "tsc index.ts -w"
}
}
I don't have a tsconfig.json file in this folder and anywere else in my pc, because this is the first time I'm using typescript.
The console error