diff --git a/test/sanity/phases/verify-install-extended.sh b/test/sanity/phases/verify-install-extended.sh index 749b3faf1..c32d8bb13 100755 --- a/test/sanity/phases/verify-install-extended.sh +++ b/test/sanity/phases/verify-install-extended.sh @@ -281,7 +281,8 @@ if ! command -v node >/dev/null 2>&1; then skip_test "NAPI module exports" "node not available" else NAPI_ROOT=$(npm root -g 2>/dev/null || echo "") - NAPI_CHECK=$(NODE_PATH="$NAPI_ROOT:$HOME/.npm-global/lib/node_modules" node -e " + NAPI_AC_NM="$NAPI_ROOT/altimate-code/node_modules" + NAPI_CHECK=$(NODE_PATH="$NAPI_ROOT:$NAPI_AC_NM" node -e " try { const m = require('@altimateai/altimate-core'); // Verify it exports something (not just an empty module) diff --git a/test/sanity/phases/verify-install.sh b/test/sanity/phases/verify-install.sh index cee8e3928..0319b711b 100755 --- a/test/sanity/phases/verify-install.sh +++ b/test/sanity/phases/verify-install.sh @@ -32,8 +32,11 @@ assert_file_exists "$HOME/.altimate/builtin/dbt-analyze/SKILL.md" "dbt-analyze s # After npm install -g, dependencies live under the global prefix's node_modules. # Node's require() doesn't search there by default — set NODE_PATH so the # NAPI module (and its platform-specific optional dep) can be found. +# npm may hoist altimate-core to the global root OR nest it under +# altimate-code/node_modules/ — include both paths. GLOBAL_NM=$(npm root -g 2>/dev/null || echo "") -assert_exit_0 "altimate-core napi binding" env NODE_PATH="$GLOBAL_NM" node -e "require('@altimateai/altimate-core')" +AC_NM="$GLOBAL_NM/altimate-code/node_modules" +assert_exit_0 "altimate-core napi binding" env NODE_PATH="$GLOBAL_NM:$AC_NM" node -e "require('@altimateai/altimate-core')" # 8. dbt CLI available if command -v dbt >/dev/null 2>&1; then @@ -105,10 +108,11 @@ DRIVERS=( DRIVER_PASS=0 DRIVER_FAIL=0 DRIVER_NODE_PATH=$(npm root -g 2>/dev/null || echo "") +DRIVER_AC_NM="$DRIVER_NODE_PATH/altimate-code/node_modules" for entry in "${DRIVERS[@]}"; do pkg="${entry%%:*}" label="${entry##*:}" - if NODE_PATH="$DRIVER_NODE_PATH" node -e "require.resolve('$pkg')" 2>/dev/null; then + if NODE_PATH="$DRIVER_NODE_PATH:$DRIVER_AC_NM" node -e "require.resolve('$pkg')" 2>/dev/null; then echo " PASS: $label driver resolvable ($pkg)" DRIVER_PASS=$((DRIVER_PASS + 1)) else