#Getting react tsc errors when I'm not even writing react

7 messages · Page 1 of 1 (latest)

gray bluff
#

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

jagged garden
#

Try reinstalling react

gray bluff
#

well

#

aparently it worked

#

tysm!

#

I didn't think it could be old react version because I didn't import react in there...

#

weird