'tsc command not found' in compiling typescript

后端 未结 15 990
耶瑟儿~
耶瑟儿~ 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:18

    A few tips in order

    • restart the terminal
    • restart the machine
    • reinstall nodejs + then run npm install typescript -g

    If it still doesn't work run npm config get prefix to see where npm install -g is putting files (append bin to the output) and make sure that they are in the path (the node js setup does this. Maybe you forgot to tick that option).

提交回复
热议问题