I installed web push :
npm i -S web-push
Then when I try to generate vapid keys typing this mand it throws an error :
./node_modules/.bin/web-push generate-vapid-keys
'.' is not recognized as an internal or external mand,
operable program or batch file.
How can I generate webpush vapid keys in node js ?
I installed web push :
npm i -S web-push
Then when I try to generate vapid keys typing this mand it throws an error :
./node_modules/.bin/web-push generate-vapid-keys
'.' is not recognized as an internal or external mand,
operable program or batch file.
How can I generate webpush vapid keys in node js ?
Share Improve this question asked Sep 20, 2020 at 14:13 Mehdi FarajiMehdi Faraji 3,83610 gold badges45 silver badges95 bronze badges 2-
try
node ./node_modules/.bin/web-push generate-vapid-keys
? – Getter Jetter Commented Sep 20, 2020 at 14:15 - @OlivierKrull I did and it throws syntax error – Mehdi Faraji Commented Sep 20, 2020 at 14:16
2 Answers
Reset to default 9You can generate the vapid-keys
with this mand:
npx web-push generate-vapid-keys [--json]
https://www.npmjs./package/web-push
I fixed the error by using \
instead of /
.\node_modules\.bin\web-push generate-vapid-keys