ts-node command not found
npm install -g ts-node
tsc types.ts 'tsc' is not recognized as an internal or external command, operable program or batch file.
1. Install as global package
To make TypeScript compiler available to all directories for this user, run the below command:
npm install -g typescript
You will see something similar to
C:\Users\username\AppData\Roaming\npm\tsserver -> C:\Users\username\AppData\Roaming\npm\node_modules\typescript\bin\tsserver C:\Users\username\AppData\Roaming\npm\tsc -> C:\Users\username\AppData\Roaming\npm\node_modules\typescript\bin\tsc + [email protected] added 1 package from 1 contributor in 4.769s
2. Set the environment variable
Add the npm installation folder to your "user variables" AND "environment variables".
In windows you can add environment variable PATH with value
C:\Users\username\AppData\Roaming\npm\
i.e. wherever the npm installation folder is present.
Note: If multiple Paths are present separate them with a ;(semicolon)
If the below command gives the version then you have successfully installed
tsc --version
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us