I've followed this thread to solve the problem
TypeScript error TS1005: ';' expected (II)
I installed Typescript as global but it always saved at C:/Users/MyName/AppData/Roaming/npm
I'm not sure if this should be global so I used npm update
then npm uninstall -g typescript
then npm install -g typescript@latest
.
My environment last variable has
C:\Users\Mostafa\AppData\Roaming\npm;
I tried to execute the code from the source so I used in the VS Code
cd C:\Users\Mostafa\AppData\Roaming\npm\node_modules\typescript\bin
then
tsc C:\Users\Mostafa\HelloWorld\src\index.ts
Also didn't work