TypeScript Debugger - The preLaunchTask 'tsc: build - tsconfig.json' terminated with exit code 127

I’m following along with mosh’s tutorial on typescript but I’m stuck at the part where we are trying to setup up the debugger. Everytime time I try to run I get this message " The preLaunchTask ‘tsc: build - tsconfig.json’ terminated with exit code 127.". In the terminal I also get this message too

Executing task: tsc -p ‘/Users/alecsmith/Documents/TypeScript Work/tsconfig.json’

zsh:1: command not found: tsc

  • The terminal process “/bin/zsh ‘-c’, ‘tsc -p ‘/Users/alecsmith/Documents/TypeScript Work/tsconfig.json’’” failed to launch (exit code: 127).
  • Terminal will be reused by tasks, press any key to close it.

I have Oh My ZSH installed and I’m using a mac with Vscode. I don’t really know where to begin with dealing with why this is happening on my end. I’ve checked multiple times to make use tsc is installed globally and it is.

Hey
I don’t know if you’ve installed typescript via npm for your project, but I found that installing it specifically for my project in VSCode worked for me. Execute this in the terminal of VSCode:
npm i typescript --save-dev

I have Typescript working on my macos terminal, but the filepaths/ directories work a bit differently for me when I use VSCode.
Anyways hope this helps.

Some more help and info if this doesn’t work: