web-push-libs / web-push

Web Push library for Node.js
Other
3.28k stars 304 forks source link

Encoding issues while generating VAPID keys #820

Closed CptHolzschnauz closed 1 year ago

CptHolzschnauz commented 1 year ago
root@test# ./node_modules/.bin/web-push generate-vapid-keys
buffer.js:800
    throw new ERR_UNKNOWN_ENCODING(encoding);
    ^

TypeError [ERR_UNKNOWN_ENCODING]: Unknown encoding: base64url
    at Uint8Array.toString (buffer.js:800:11)
    at Object.generateVAPIDKeys (/babapush/node_modules/web-push/src/vapid-helper.js:63:32)
    at generateVapidKeys (/babapush/node_modules/web-push/src/cli.js:45:29)
    at Object.<anonymous> (/babapush/node_modules/web-push/src/cli.js:126:5)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    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 Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'ERR_UNKNOWN_ENCODING'
}
marco-c commented 1 year ago

@CptHolzschnauz what Node version are you using?

CptHolzschnauz commented 1 year ago

Welcome to Node.js v12.22.9.

marco-c commented 1 year ago

Node 12 is no longer supported. The minimum supported version is Node 16.

CptHolzschnauz commented 1 year ago

Sorry for the hassle. I didn't get that's a version 16. With ubuntu 12 is somehow standard. My fault. Thank you anyway.