3

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 Answer 1

3

Add ~/node/bin folder to the PATH variable

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

1
  • 1
    I new i messed up something while installing node. Mac is new to me. Following is what i did and it worked. Thank you @Lazyexper. PATH=$PATH:/Users/myuserid/node/bin and it worked.
    – venu
    Sep 14, 2017 at 15:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.