ERROR in ./ansi-html 1:0 Module parse failed: Unexpected character ‘#’ (1:0)

I am learning angular js. When I run ng serve –open I get below error

ERROR in ./ansi-html 1:0
Module parse failed: Unexpected character '#' (1:0)
You may need an appropriate loader to handle this file type
> #!/bin/sh
| basedir=$(dirname "$(echo "$0" | sed -e 's,,/,g')")

angular CLI version is 6.2.0

node version is 8.11.4

npm version is 6.4.1

ansi-html file is as

#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,,/,g')")

case `uname` in
    *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac

if [ -x "$basedir/node" ]; then
  "$basedir/node"  "$basedir/node_modules/ansi-html/bin/ansi-html" "[email protected]"
  ret=$?
else 
  node  "$basedir/node_modules/ansi-html/bin/ansi-html" "[email protected]"
  ret=$?
fi
exit $ret

If I remove first line then error is

ERROR in ./ansi-html 1:18
Module parse failed: Unexpected token (1:18)
You may need an appropriate loader to handle this file type.
> basedir=$(dirname "$(echo "$0" | sed -e 's,,/,g')")
|
| case `uname` in
i ?wdm?: Failed to compile.

Source: AngularJS