npm package.json bin won't work on Windows

前端 未结 4 642
天涯浪人
天涯浪人 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:12

    Answer from Rodrigo Medeiros works for me, but only if I have too the shebang line at the .js file.

    There I had another issue. I have node.js installed at c:\Program files\nodejs, and this was my shebang line:

    #!c:/program files/nodejs/node
    

    This didn't work, because the blank space. This was the correct one:

    #!c:/progra~1/nodejs/node
    

提交回复
热议问题