WebPackBuild:Failed with code: 'ERR_OSSL_EVP_UNSUPPORTED', reason: 'unsupported', library: 'digital envelope routines',

Error details:
[ERR] WebPackBuild: opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error’ ],
[ERR] WebPackBuild: library: ‘digital envelope routines’,
[ERR] WebPackBuild: reason: ‘unsupported’,

  [ERR] WebPackBuild:     at /home/runner/work/vc-module-inventory/vc-module-inventory/src/VirtoCommerce.InventoryModule.Web/node_modules/graceful-fs/graceful-fs.js:115:16
  [ERR] WebPackBuild:     at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) {
  [ERR] WebPackBuild:   opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  [ERR] WebPackBuild:   library: 'digital envelope routines',
  [ERR] WebPackBuild:   reason: 'unsupported',
  [ERR] WebPackBuild:   code: 'ERR_OSSL_EVP_UNSUPPORTED'
  [ERR] WebPackBuild: }
  [ERR] WebPackBuild: Node.js v18.14.1
  [ERR] WebPackBuild: Target WebPackBuild failed
Target             Status      Duration
Clean              Skipped                // SkipReason: via --skip parameter
Restore            Skipped                // SkipReason: via --skip parameter
Compile            Skipped                // SkipReason: via --skip parameter
WebPackBuild       Failed          0:13   // ProcessException: Process 'npm' exited with code 1.
Test               Skipped                // SkipReason: via --skip parameter
Publish            NotRun              
Compress           NotRun              
Total                              0:13
Build failed on 02/20/2023 11:21:34. (╯°□°)╯︵ ┻━┻

To resolve the issue, please setup NodeJS 16.x.

On local machine please download and install Iv16.14.0 (nodejs.org)

On GitHub workflow, you need to Setup Node.js environment:

      - name: Set up Node 16
        uses: actions/setup-node@v2
            node-version: '16'

Also, you can set Node.js options before compress the module solution:

Thanks for posting the solution. We started running into this error in our projects. :slight_smile:

@OlegoO Is there any near term plan to upgrade dependencies so that we are not bypassing the openssl check?

We are working under update for using NodeJS LTS.

1 Like

If you plan update to module to support WebPack 5 and NodeJS 18, please use files from this PR:

PT-9395: Update to support NodeJS 18 LST and WebPack 5

Usually, you can just copy, override existen files: webpack.config.js, package.json and package-lock.json and change moduleId in webpack.config.js.

Some other adjustments could be required, if you used custom components.

We have update all VC modules to support NodeJS LTS and WebPack 5.

Also, you can use vc-cli-module-template to get actual version of files.