It seems I need to do this in the rails project (default importmap), then it works
npm install puppeteer
Only problem is generating PDF on my local Mac is really slow. At first I suspect it is due to the image size, but even a post with just some text (1 liner), take 2 - 3 seconds to create the PDF.
Do you have alternatives which works well with latest rails and able to generate PDF (or even add passwords, etc)? Thanks.