Error "tsc command not found" when compiling TypeScript
Hello everyone! I just started learning TypeScript and ran into a problem when trying to compile my first file. I installed Node.js and npm, created a simple file `hello.ts`:
```typescript
function greet(name: string): string {
return `Hello, ${name}!`;
}
console.log(greet("World"));
```
I'm trying to run compilation via terminal with the command `tsc hello.ts`, but I get the error: "tsc command not found". I checked that Node.js and npm are installed — the commands `node -v` and `npm -v` work. I tried to install TypeScript globally via `npm install -g typescript`, but it still doesn't work after that. What could be the problem? Maybe I need to configure something extra or set up paths? I'm using Windows 10, if that matters. I would be grateful for help to a beginner!
<<>>
No answers yet.
Log in to leave an answer
Blogs
SOLID Principles in Kotlin: Theory and Practice with Code Examples
Deploying a Go Application on VPS: Step-by-Step Guide