Zowe CLI returns Unexpected Command Error _a.trim is not a function
search cancel

Zowe CLI returns Unexpected Command Error _a.trim is not a function

book

Article ID: 393185

calendar_today

Updated On:

Products

Brightside

Issue/Introduction

This issue is being encountered by multiple users on different versions of zowe cli (7.27.0, 8.11.0, 8.13.0) with the same error appearing across all versions.
 
$ zowe zos-jobs download output <jobid> 
Unexpected Command Error:
Please review the message and stack below.
...
Message:
_a.trim is not a function
Stack:
TypeError: _a.trim is not a function

Environment

Component:  Zowe CLI

Resolution

To find configurations file, type

zowe zos-jobs download output <jobid> --show-inputs-only

into your terminal. This shows a list of locations for your configurations in order of precedence.

Edit the configurations at those locations, encoding shows to be set as a number,

  encoding:            1047

but it needs to be set as a string.

  encoding:            "1047"

You can either change this value to a string by wrapping the encoding value in quotes or by removing the encoding property entirely from your active profile. 

Additional Information

This issue is rarely seen and a fix has been implemented that will be available for the next Enterprise Support for Zowe release and is already available as the latest changes for CLI versions 2 and 3 available on npm.