Skip to content

Commit

Permalink
Explain missing nodeJS error better (v2) (#4124)
Browse files Browse the repository at this point in the history
* Update json.sh

Signed-off-by: 1000TurquoisePogs <[email protected]>

* Update .errors

Signed-off-by: 1000TurquoisePogs <[email protected]>

* Update json.sh

Signed-off-by: 1000TurquoisePogs <[email protected]>

---------

Signed-off-by: 1000TurquoisePogs <[email protected]>
  • Loading branch information
1000TurquoisePogs authored Jan 9, 2025
1 parent 09ab26c commit 7a0543c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bin/commands/.errors
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ ZWEL0200E||Failed to copy USS file %s to MVS data set %s.
ZWEL0201E||File %s does not exist.
ZWEL0202E||Unable to find samplib key for %s.
ZWEL0203E||Env value in key-value pair %s has not been defined.
ZWEL0316E||Command requires zowe.useConfigmgr=true to use.
ZWEL0316E||Command requires zowe.useConfigmgr=true to use.
ZWEL0319E||NodeJS required but not found. Errors such as ZWEL0157E may occur as a result. The value 'node.home' in the Zowe YAML is not correct.
7 changes: 7 additions & 0 deletions bin/libs/json.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ read_yaml() {
code=$?
print_trace " * Exit code: ${code}"
if [ ${code} -ne 0 ]; then
# Check for "node ... FSUM7351 not found". Common user error that we can solve more quickly by providing advice below.
missing_id_check=$(echo "${ZWE_PRIVATE_YAML_CACHE}" | grep "FSUM7351" 2>&1)
if [ -n "${missing_id_check}" ]; then
print_error "Error ZWEL0319E: NodeJS required but not found. Errors such as ZWEL0157E may occur as a result."
print_error "The value 'node.home' in the Zowe YAML is not correct. Set it to the parent directory of 'bin/node'."
print_error "For example, if NodeJS is at '/opt/nodejs/bin/node', then set 'node.home' to '/opt/nodejs'."
fi
print_error " * Output:"
print_error "$(padding_left "${ZWE_PRIVATE_YAML_CACHE}" " ")"
return ${code}
Expand Down

0 comments on commit 7a0543c

Please sign in to comment.