akamai / cli-sandbox

Akamai CLI for Sandbox
https://github.com/akamai/cli
Apache License 2.0
13 stars 12 forks source link

No sandbox installation - tsc error on install #103

Open kavika-1 opened 3 years ago

kavika-1 commented 3 years ago

akamai install sandbox fails with the cryptic unable to execute package manager: npm manually cloning cli-sandbox and running npm install results in:

...

> akamai-sandbox-cli@1.5.0 build-ts /home/david/.akamai-cli/src/cli-sandbox
> tsc

src/utils/cli-utils.ts:71:43 - error TS2345: Argument of type '{ year: string; month: string; day: string; hour: string; minute: string; timeZone: string; timeZoneName: string; }' is not assignable to parameter of type 'DateTimeFormatOptions'.
  Types of property 'year' are incompatible.
    Type 'string' is not assignable to type '"numeric" | "2-digit"'.

71   return new Intl.DateTimeFormat('en-US', options).format(date)

Was able to successfully complete npm install by editing this file on-box. Simplest fix appears to be fixing the const declaration for function dateToString(date) by typeing options like const options: Intl.DateTimeFormatOptions = ...

herzykj commented 1 year ago

try it again on new cli-sandbox version (1.6.0). If it still won't work please share your node version, npm version, os, and Java version.