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 committed Jul 1, 2024
1 parent bab0d20 commit a539939
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 a539939

Please sign in to comment.