How can I generate a tsconfig.json file?

后端 未结 9 439
失恋的感觉
失恋的感觉 2020-12-04 10:48

How can I generate a tsconfig.json via the command line? I tried command tsc init, but this doesn\'t work.

9条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-04 10:57

    For those who have TypeScript installed as a local package (and possibly as a dev dependency) via:

    $ npm install typescript --save-dev
    

    ...and who have added tsc script to package.json:

    "scripts": {
       ...
       "tsc": "tsc"
    },
    

    You can call tsc --init via npm:

    $ npm run tsc -- --init 
    

提交回复
热议问题