Does Twilio Flex UI support Node 18 and NPM 8?

I am trying to follow the instructions from Twilio Flex found at: Twilio Flex Quickstart: Getting Started with React Plugin Development

I keep running into errors and can not figure them out. I’ve tried doing this on Windows and macOS and it’s the same result. I am using NVM to use Node.js v18.13.0 and NPM v8.19.3. The only thing I can think of is that maybe Twilio Flex does not support the current versions of Node and NPM. Does anyone know what I’m doing wrong?

Terminal output:

Starting development server (static)...
ℹ 「wds」: Project is running at http://localhost:3100//
ℹ 「wds」: webpack output is served from undefined
ℹ 「wds」: Content not from webpack is served from /Users/username/plugin-sample
  this[kHandle] = new _Hash(algorithm, xofLen);

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:133:10)
    at module.exports (/Users/username/.twilio-cli/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/Users/username/.twilio-cli/node_modules/webpack/lib/NormalModule.js:417:16)
    at handleParseError (/Users/username/.twilio-cli/node_modules/webpack/lib/NormalModule.js:471:10)
    at /Users/username/.twilio-cli/node_modules/webpack/lib/NormalModule.js:503:5
    at /Users/username/.twilio-cli/node_modules/webpack/lib/NormalModule.js:358:12
    at /Users/username/.twilio-cli/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/Users/username/.twilio-cli/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at Array.<anonymous> (/Users/username/.twilio-cli/node_modules/loader-runner/lib/LoaderRunner.js:205:4) {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',

Node.js v18.13.0

Here is the commands I have run so far (in order):

curl -o- | bash
nvm install --lts
brew tap twilio/brew && brew install twilio
twilio login
twilio flex:plugins:create plugin-sample --install --flexui2
cd plugin-sample
twilio flex:plugins:start

I have tried installing legacy versions of Node 16 and Node 14 with varying degrees of success. At one point I was able to actually have the plugin running on localhost but I had many errors and it would not let me publish the plugin. Since then, I have not been able to recreate this somewhat successful output.

>Solution :

According to the installation instructions, Node 10.12 through 14 are supported. They are working towards support for 16. So using node 18 would be a very likely cause of the error.

You can switch to a supported version by doing nvm install 14.

To keep this version as your new default, you’ll need to set it: nvm alias default 14.

Leave a Reply