4

Eclipse (Luna) is clearly launching grunt as the external build tool. However, the Eclipse console keeps showing the "env: node: No such file or directory" message and the grunt tasks do not get to run.

I can successfully run grunt on the command line (outside Eclipse) after moving to the project directory.

The node installer did place it on /usr/local/bin/node but apparently grunt is expecting it somewhere else.

Suggestions?

Bienvenido Velez
  • 139
  • 1
  • 1
  • 6

4 Answers4

21

if you are using Homebrew try

brew unlink node

then

 brew link node
heLL0
  • 1,357
  • 3
  • 23
  • 30
9

I discovered that grunt is apparently expecting node to live on /usr/bin, yet the installer placed it on /usr/local/bin.

Solution:

sudo ln -s /usr/local/bin/node /usr/bin/node

Hope helps.

shershen
  • 9,875
  • 11
  • 39
  • 60
Bienvenido Velez
  • 139
  • 1
  • 1
  • 6
  • 21
    i get **ln: /usr/bin/node: Operation not permitted** then – shershen May 22 '16 at 07:08
  • ln: /usr/bin/node: Operation not permitted on mac m/c how to resolve it ?here link : https://stackoverflow.com/questions/43495229/env-node-no-such-file-or-directory-using-jenkings-windows-machine-node-and – Swift Apr 20 '17 at 09:46
3

The "External Tools Configurations" dialog has a tab for setting the environment the command will run in. In this tab, press "Select..." and select "PATH...". Once it's there you can edit the Value to append ":/usr/local/bin". After this both "node" and "npm" are found and commands work just fine.

1
sudo chown -R $USER /usr/local
brew unlink node
brew link node
Aymon Fournier
  • 4,323
  • 12
  • 42
  • 59
  • 3
    While this may answer the question, please add a short explanation to your post and describe what your commands actually do and how they solve the initial problem. Don't just drop some lines of code. – user1438038 Jul 26 '17 at 08:58