Node script executable not working on Mac : env: node\r: No such file or directory

前端 未结 6 1152
清酒与你
清酒与你 2021-01-31 19:10

I have created my node script executable to execute some tasks grunt. On Windows, my node script works fine. But on Mac OS X (Yosemite), it\'s not working.

My node scri

6条回答
  •  佛祖请我去吃肉
    2021-01-31 19:53

    After all, I found the solution to my problem.

    As my node script file has been created on Windows, the file is DOS format (line endings in DOS format I think). So, I used a module which allow to converting a file to a unix format :

    brew install dos2unix
    sudo dos2unix /usr/local/lib/node_modules/task-app/src/task-app.js
    

提交回复
热议问题