We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2cfe795 commit a99b8b0Copy full SHA for a99b8b0
test/slow/nvm exec/Running 'nvm exec --lts' when NVM_DIR differs from nvm
@@ -0,0 +1,18 @@
1
+#!/bin/sh
2
+
3
+set -ex
4
5
+die () { echo "$@" ; exit 1; }
6
7
+INSTPATH="$(mktemp -p "$(pwd)" -d)"
8
+trap 'test ! -z "${INSTPATH-}" && test -d "$INSTPATH" && rm -rf "$INSTPATH"' EXIT
9
+declare -x NVM_DIR=$INSTPATH
10
+\. ../../../nvm.sh
11
12
+nvm install --lts || die 'nvm install --lts failed'
13
+nvm exec --lts npm --version || die "`nvm exec` failed to run"
14
+declare -x NODE_VERSION="$(nvm exec --lts --silent node --version)"
15
16
+ln -s ../../../../nvm-exec "$INSTPATH/nvm-exec" || die "failed to create a symlink to $INSTPATH/"
17
+"$INSTPATH/nvm-exec" npm ls > /dev/null || die "`nvm exec` failed to run using nvm-exec helper"
18
0 commit comments