'tsc command not found' in compiling typescript

后端 未结 15 880
耶瑟儿~
耶瑟儿~ 2020-12-05 02:02

I want to install typescript, so I used the following command:

npm install -g typescript 

and test tsc --version, but it just

相关标签:
15条回答
  • 2020-12-05 02:28

    Easy fix for Mac I found. Just run these commands:

    sudo npm install -g concurrently
    sudo npm install -g lite-server
    sudo npm install -g typescript
    

    Nothing worked except this for me.

    0 讨论(0)
  • 2020-12-05 02:29

    After finding all solutions for this small issue for macOS only.
    Finally, I got my TSC works on my MacBook pro.

    This might be the best solution I found out.

    For all macOS users, instead of installing typescript using npm, you can install typescript using homebrew.

    --> brew install typescript

    Please see attached screencap for reference.

    Thank you.

    enter image description here

    0 讨论(0)
  • 2020-12-05 02:29

    The only solution that work for me was put npx tsc -v or for the compiling npx tsc salida.ts

    "salida.ts" is the name of the file

    0 讨论(0)
提交回复
热议问题