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

PauloDev

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 script has been published on Windows.

My node script is installed via npm command :

npm install -g task-app

My node script have this first line :

#! /usr/bin/env node

I tried many some solutions to solve my problem but I'm still stuck.

Here's these solutions that I used :

  1. uninstall and reinstall Node.js
  2. execute this command to create a link for node : sudo ln -s /usr/bin/nodejs /usr/local/bin/node
  3. set my path with this command : export PATH=$PATH:/usr/local/bin/node

Do you have other solutions to propose ?

EDIT :

the beginning of my script :

#! /usr/bin/env node

var grunt = require('grunt');

//Get parameters from command line
var args = process.argv.splice(2);

[...]
PauloDev

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

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

env: ruby_executable_hooks: No such file or directory

From Dev

bundle update: env: ruby_executable_hooks: No such file or directory

From Dev

bundle update: env: ruby_executable_hooks: No such file or directory

From Dev

"cake bake" returns "env: node: No such file or directory"

From Java

Node forever /usr/bin/env: node: No such file or directory

From Dev

Unix Executable to the directory it is housed in Mac

From Dev

Html file is not working on php directory script website

From Dev

"No such file or directory" when running node script

From Dev

env: node\r: No such file or directory with browserify-rails

From Java

Cannot install NodeJs: /usr/bin/env: node: No such file or directory

From Dev

env: node: No such file or directory in phpstorm when compiling less

From Java

browserify error /usr/bin/env: node: No such file or directory

From Dev

Sublime Text CoffeeScript build system: `env: node: No such file or directory`

From Dev

CRON JOB ERROR /usr/bin/env: node: No such file or directory

From Dev

"/usr/bin/env: ‘node’: No such file or directory" even though it is in PATH

From Dev

Env node\r: No such file or directory with 3dio-js

From Dev

"/usr/bin/env: ‘node’: No such file or directory" on terminal startup

From Java

How to solve "/usr/bin/env: ruby_executable_hooks: No such file or directory"?

From Dev

Running executable file: No such file or directory

From Dev

directory has a executable file mode

From Dev

How do I make my Python Script into an Executable .dmg file for Mac?

From Dev

env: node: No such file or directory (using jenkings, windows machine, node and a remote web interface)

From Dev

Executable symbolic link file not working

From Dev

Run executable file in linux - not working

From Dev

Change current working directory from batch file and run script

From Dev

Shell script Copy file from one directory to another not working

From Dev

Set working directory for script

From Dev

Make a script executable in bin directory ant

From Java

env: bash\r: No such file or directory

Related Related

  1. 1

    env: ruby_executable_hooks: No such file or directory

  2. 2

    bundle update: env: ruby_executable_hooks: No such file or directory

  3. 3

    bundle update: env: ruby_executable_hooks: No such file or directory

  4. 4

    "cake bake" returns "env: node: No such file or directory"

  5. 5

    Node forever /usr/bin/env: node: No such file or directory

  6. 6

    Unix Executable to the directory it is housed in Mac

  7. 7

    Html file is not working on php directory script website

  8. 8

    "No such file or directory" when running node script

  9. 9

    env: node\r: No such file or directory with browserify-rails

  10. 10

    Cannot install NodeJs: /usr/bin/env: node: No such file or directory

  11. 11

    env: node: No such file or directory in phpstorm when compiling less

  12. 12

    browserify error /usr/bin/env: node: No such file or directory

  13. 13

    Sublime Text CoffeeScript build system: `env: node: No such file or directory`

  14. 14

    CRON JOB ERROR /usr/bin/env: node: No such file or directory

  15. 15

    "/usr/bin/env: ‘node’: No such file or directory" even though it is in PATH

  16. 16

    Env node\r: No such file or directory with 3dio-js

  17. 17

    "/usr/bin/env: ‘node’: No such file or directory" on terminal startup

  18. 18

    How to solve "/usr/bin/env: ruby_executable_hooks: No such file or directory"?

  19. 19

    Running executable file: No such file or directory

  20. 20

    directory has a executable file mode

  21. 21

    How do I make my Python Script into an Executable .dmg file for Mac?

  22. 22

    env: node: No such file or directory (using jenkings, windows machine, node and a remote web interface)

  23. 23

    Executable symbolic link file not working

  24. 24

    Run executable file in linux - not working

  25. 25

    Change current working directory from batch file and run script

  26. 26

    Shell script Copy file from one directory to another not working

  27. 27

    Set working directory for script

  28. 28

    Make a script executable in bin directory ant

  29. 29

    env: bash\r: No such file or directory

HotTag

Archive