AFAICT by searching the source code, "Unexpected JSON token" isn't a message generated from closure-compiler itself.
I suspect something's gone wrong before it got invoked.
I have no idea how to "compile the openindoor6 library using closure-compiler (npm package) using the npx command"
and suspect it would take an unreasonable amount of setup to get there.
If you can narrow the problem down to a snippet of JS and a closure-compiler command line that reproduces the problem,
it'll be easier for folks here to help you out.
Best regards,
Bradford