Collids with our graal npm wrapper and we would need that wrapper for pnpm and yarn also anyway
solution
rm the wrappers inside language/js/bin
create tool to create a graal compatible wrapper
original wrapper
graalvm-ce-java15-20.3.0/languages/js/bin/npx-graal
#!/usr/bin/env bash
source="${BASH_SOURCE[0]}"
while [ -h "$source" ] ; do
prev_source="$source"
source="$(readlink "$source")";
if [[ "$source" != /* ]]; then
# if the link was relative, it was relative to where it came from
dir="$( cd -P "$( dirname "$prev_source" )" && pwd )"
source="$dir/$source"
fi
done
bin_dir="$( cd -P "$( dirname "$source" )" && pwd )"
parent_bin_dir="$( dirname "$bin_dir" )"
NODE_ARGS=()
PROGRAM_ARGS=()
NODE_DIR="--nodedir=${parent_bin_dir}"
for opt in "${@:1}"; do
case "${opt}" in
--nodedir=*)
NODE_DIR="${opt}" ;;
--vm*)
NODE_ARGS+=("${opt}") ;;
--jvm*)
NODE_ARGS+=("${opt}") ;;
--native*)
NODE_ARGS+=("${opt}") ;;
*)
PROGRAM_ARGS+=("${opt}") ;;
esac
done
NODE_ARGS+=("--engine.Mode=latency")
PATH="${bin_dir}:$PATH"
if [ "$(uname -s)" == "SunOS" ]; then
# node packages typically expect to run with gnu tools
if [ "${GNU_BINDIR}x" == "x" ]; then
GNU_BINDIR="/usr/gnu/bin"
fi
PATH="${GNU_BINDIR}:${PATH}"
# Use GCC instead of Solaris Studio Compiler
export CC="gcc"
export CXX="g++"
export CFLAGS="-m64 -U__EXTENSIONS__"
export CXXFLAGS="$CFLAGS"
export LDFLAGS="-m64"
fi
export PATH
exec "${bin_dir}/node" "${NODE_ARGS[@]}" "${parent_bin_dir}/npm/bin/npx-cli.js" "${NODE_DIR}" "${PROGRAM_ARGS[@]}"
since this wrapper needs to get called always when a node cli app gets used we need to apply this wrapper to node in general
graalvm/bin/node
graalvm/languages/js/bin/node
most easy npm update
mkdir -p /tmp/npm-upgrade
cd /tmp/npm-upgrade
npm pack npm
tar -xzf npm-*.tgz --strip-components=1 -C $GRAALVM_HOME/languages/js/npm
rm -rf npm-*.tgz
Collids with our graal npm wrapper and we would need that wrapper for pnpm and yarn also anyway
solution
rm the wrappers inside language/js/bin create tool to create a graal compatible wrapper
original wrapper
since this wrapper needs to get called always when a node cli app gets used we need to apply this wrapper to node in general
graalvm/bin/node graalvm/languages/js/bin/node
most easy npm update