Search code examples
javascriptnode.jsexpressnode-modulesweb-push

How to generate web push vapid keys in node js?


I installed web push :

npm i -S web-push

Then when I try to generate vapid keys typing this command it throws an error :

./node_modules/.bin/web-push generate-vapid-keys
'.' is not recognized as an internal or external command,
operable program or batch file.

How can I generate webpush vapid keys in node js ?


Solution

  • I fixed the error by using \ instead of /

    .\node_modules\.bin\web-push generate-vapid-keys