'tsc command not found' in compiling typescript

后端 未结 15 985
耶瑟儿~
耶瑟儿~ 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条回答
  •  旧时难觅i
    2020-12-05 02:10

    you are all messing with the global installations and -path files. Just a little error might damage every project you have ever written, and you will spend the rest of the nite trying to get a console.log('hi') to work again:-=.

    If you have run npm i typescript --save-dev in your project - just try to run:

    npx tsc

    and see if it works before messing with global stuff (unless ofc you really know what you are doing)

    cheers

提交回复
热议问题