Skip to content

Commit

Permalink
fix(core): Add a WebCrypto Polyfill for older versions of Node.js 18 (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
netroy authored Jul 1, 2024
1 parent dc1c5fc commit 59c8bf1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/cli/bin/n8n
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ if (process.env.NODEJS_PREFER_IPV4 === 'true') {
// More details: https://github.com/nodejs/node/issues/48145
require('net').setDefaultAutoSelectFamily?.(false);

// WebCrypto Polyfill for older versions of Node.js 18
if (!globalThis.crypto?.getRandomValues) {
globalThis.crypto = require('node:crypto').webcrypto;
}

(async () => {
const oclif = await import('@oclif/core');
await oclif.execute({ dir: __dirname });
Expand Down

0 comments on commit 59c8bf1

Please sign in to comment.