Node npm package throw use strict: command not found after publish and install globaly

前端 未结 1 698
自闭症患者
自闭症患者 2021-01-03 20:20

I am trying to publish npm package, when i am install the package globally and try to run the cli command i get this errors:

/.nvm/versions/node/v0.12.2/bin/         


        
相关标签:
1条回答
  • 2021-01-03 20:53

    Your script should start with a shebang line, otherwise it will be executed as a shell script (hence the errors).

    Add this as first line to dist/myPack.js:

    #!/usr/bin/env node
    
    0 讨论(0)
提交回复
热议问题