twilio / twilio-cli

Unleash the power of Twilio from your command prompt
MIT License
162 stars 79 forks source link

fix: use bundled node version for post install #554

Open Eric-Tyrrell22 opened 1 year ago

Eric-Tyrrell22 commented 1 year ago

Fixes

twilio-cli throws an error when running the post-install script if the node version doesn't support optional chaining. Since it's already installing a full node runtime, it might as well use it for this.

root@eric-MS-7C02:~# apt-get upgrade -y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
...
Setting up twilio (5.14.0-1) ...
/usr/lib/twilio-cli/node_modules/@oclif/core/lib/command.js:41
            delete this.globalFlags?.json;
                                    ^

SyntaxError: Unexpected token '.'
    at wrapSafe (internal/modules/cjs/loader.js:915:16)
    at Module._compile (internal/modules/cjs/loader.js:963:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/usr/lib/twilio-cli/node_modules/@oclif/core/lib/index.js:6:19)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
dpkg: error processing package twilio (--configure):
 installed twilio package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 twilio
E: Sub-process /usr/bin/dpkg returned an error code (1)

Made the edit to the post install script locally and it worked. Unsure of how to test the github action itself, so hopefully someone can help me with that.

Checklist

If you have questions, please file a support ticket, or create a GitHub Issue in this repository.