How to make a shell executable node file using TypeScript

前端 未结 7 1906
日久生厌
日久生厌 2021-02-05 05:56

Normally in node files I just put

#!/usr/bin/env node 

at the top and make it executable to create a file that can be run from a bash terminal.

7条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-05 06:59

    In case anyone is still struggling with making it work, the ts file should start with #! node instead of #!/usr/bin/env node, and tsc will take care of the rest.

提交回复
热议问题