npm package.json bin won't work on Windows

前端 未结 4 731
天涯浪人
天涯浪人 2021-02-12 11:39

I am trying to start my cli tool via the package.json bin property.

I have the following:

...
\"name\": \"mycli\",
\"bin\": \"./bin/mycli\",         


        
4条回答
  •  半阙折子戏
    2021-02-12 12:17

    If you put

    #!/usr/bin/env node
    

    in the first line of your script, npm will create the necessary wrapper scripts.

提交回复
热议问题