0
votes

Welcome, I can't run Typescript all my day. I use Visual Studio Code. What I am doing is installing TS globally:

$ npm install -g typescript

Then when I check it:

$ tsc

I get that error in all cases:

bash: tsc: command not found

To that time I have tried following solutions:

  1. Setting npm config:

$ npm config set prefix /usr/local

What I get after npm root -g is:

C:\Program Files\Git\usr\local\node_modules

  1. Setting npm config by relative way to get (And I get it):

    C:\usr\local\node_modules

  2. Setting .bash_profile:

export PATH=/usr/local/share/npm/bin:$PATH

  1. Setting .bashrc with PATH also...

  2. Installing Typecript as dev dependency also don't work.

  3. Other small solutions that I even don't remember.

Please for help. I can provide more information that you need - just say what.

1
Maybe you can consider the answer in this post: stackoverflow.com/questions/46687102/… - edkeveked

1 Answers

1
votes

Tried every known solution

Will definitely work:

  • Uninstall nodejs
  • Install nodejs (make sure you ask it to set PATH for you)
  • npm install typescript -g

🎊🌹