question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

node: command not found

See original GitHub issue
PhaseScriptExecution Download\ Core /Users/me/Library/Developer/Xcode/DerivedData/Ology-dyfbenzvbbghgeebclxmorqgivwr/Build/Intermediates.noindex/RealmJS.build/Debug-iphonesimulator/RealmJS.build/Script-F63FF2C51C12462600B3B8E0.sh
    cd /Users/me/project/node_modules/realm/src
    /bin/sh -c /Users/me/Library/Developer/Xcode/DerivedData/Ology-dyfbenzvbbghgeebclxmorqgivwr/Build/Intermediates.noindex/RealmJS.build/Debug-iphonesimulator/RealmJS.build/Script-F63FF2C51C12462600B3B8E0.sh

/Users/me/Library/Developer/Xcode/DerivedData/Ology-dyfbenzvbbghgeebclxmorqgivwr/Build/Intermediates.noindex/RealmJS.build/Debug-iphonesimulator/RealmJS.build/Script-F63FF2C51C12462600B3B8E0.sh: 
line 2: node: command not found
Command /bin/sh failed with exit code 127

I get this error on a current project that I installed on a new machine.

Node was installed through nvm react-native 0.49.5 realm-js 2.0.2 Mac OS High Sierra nvm ls

->       v8.8.1
default -> 8.8.1 (-> v8.8.1)
node -> stable (-> v8.8.1) (default)
stable -> 8.8 (-> v8.8.1) (default)
iojs -> N/A (default)
lts/* -> lts/boron (-> N/A)
lts/argon -> v4.8.5 (-> N/A)
lts/boron -> v6.11.5 (-> N/A)

When I run node on the command line, it works normally.

Any ideas?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:18 (8 by maintainers)

github_iconTop GitHub Comments

240reactions
robhogancommented, Oct 31, 2017

Oh, yeah sorry that’s probably because when you run /bin/sh from your terminal it’s picking up the PATH from the parent shell, which allows node to work.

Different approach then, try (from your usual terminal where node is working):

ln -s $(which node) /usr/local/bin/node

That should put a symlink to node somewhere in the PATH that sh uses. If it already exists, I’m stumped.

3reactions
andrekovaccommented, Aug 10, 2018

On OSX, I installed node@8 with homebrew which points to /usr/local/opt/node@8/bin/node instead of /usr/local/bin/node.

So ln -s $(which node) /usr/local/bin/node as written by @rh389 does the trick!

Read more comments on GitHub >

github_iconTop Results From Across the Web

node: command not found [duplicate] - Stack Overflow
The problem is that your PATH does not include the location of the node executable. You can likely run node as " /usr/local/bin/node...
Read more >
NPM Command Not Found - Linux Hint
On Windows, you may face the “npm command not found” error if the path to nodejs and npm are not added to your...
Read more >
How to Fix "npm command not found" Error {Node JS}
Why NPM command is not working? ... The reason may be either the npm package is not installed, incorrectly installed or the path...
Read more >
Installing Nodejs: sh: node: command not found error - Intellipaat
The command not found error you are getting because your PATH does not include the location of the node executable. So you can...
Read more >
Bash: Node: Command Not Found - Medium
The fastest way to get to your environment variables is to type in the search bar in the bottom left corner of your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found