3
votes

I am using MAC and trying to install TypeScript. I install typescript using

sudo npm install -g typescript

following is the result

Password:
/Users/<myuserid>/node/bin/tsc -> /Users/<myuserid>/node/lib/node_modules/typescript/bin/tsc
/Users/<myuserid>/node/bin/tsserver -> /Users/<myuserid>/node/lib/node_modules/typescript/bin/tsserver
/Users/<myuserid>/node/lib
└── [email protected] 

Now when i try to use tsc i get error

venu-mac:~ myuserid$ tsc
-bash: tsc: command not found
venu-mac:~ myuserid$

I do see tsc and tsserver exe files and following is tsc content

$!/usr/bin/env node
require('../lib/tsc.js')

when I use following command from home it works

~ myuserid$ node/bin/tsc -v
Version 2.5.2

Same with Angular CLI installation. I use the following command to install Angualr via CLI:

sudo npm install -g @angular/cli

There are no errors or warnings while installing Angular CLI, but whenever I use ng commands I get the following:

-bash: ng: command not found

I tried removing/uninstalling all typescript and ng then reinstalling, upgrade but it's been of no use...

1

1 Answers

3
votes

Add ~/node/bin folder to the PATH variable

Advice: do not use that manuall nodejs install. Have a look at nvm.