wkhtmltopdf I’m fairly certain is a server-side package. That thing tries to spawn a new process that will run a headless webkit in order to parse your html and generate a PDF from it. You may not have been paying attention while attempting the above, because if you think about it it becomes quite clear that maybe that’s not an npm package that has any chance of running client-side
EDIT: And to explain the error message: ‘spawn’ is a method found in node’s child_process module. That’s not available on the client.