Skip to content

Improve support under Git Bash #62

@txava

Description

@txava

I'm getting the following error when running a node bin like ng (Angular CLI) under Git Bash.
/D/Workspaces/codemix_test/cm622/node_modules/.bin/node: line 1: /../node/bin/node: No such file or directory

The problem seems to be related with how basedir it is calculated.

I had to make the following changes to "node_modules/.bin/node" in order to make it work:

#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
    *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac

if [ -x "$basedir/../node/bin/node" ]; then
  "$basedir/../node/bin/node" "$@"
 else
  "$basedir/../node/bin/node.exe" "$@"
fi

exit $?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions