Open GetPsyched opened 1 year ago
I am on NixOS
Well, it means that "prince" is not in $PATH and that node-prince was also unable to determine that NixOS is a Linux environment. So, either you have to install PrinceXML manually into the system before using node-prince or we have to figure out what check is needed to recognize NixOS in https://github.com/rse/node-prince/blob/master/prince-npm.js
I have installed PrinceXML manually on my system but I was having issues doing the same on the deployed instance of my application (which also runs it on NixOS AFAIK).
or we have to figure out what check is needed to recognize NixOS in https://github.com/rse/node-prince/blob/master/prince-npm.js
How can I help with that? I'm willing to do some debugging if you wish.
I just cloned this repo and ran npm install
. Here's the logs:
It actually does detect NixOS as a Linux environment and chooses the correct package. But it does not do this when using node-prince
as a dependency.
@rse any comment?
I've tried it out: I've created a package.json with a dependency to "prince" and then have run...
npm --loglevel=silly i --foreground-scripts
...(with NPM 10.2.3) and the "install" script was correctly executed inside the "prince" package (it downloaded PrinceXML and unpacked it). So, perhaps it is an issue with your particular/older NPM version?
I'm getting a new error after updating prince
to 1.11.1:
Error: {"error":{"errno":-2,"code":"ENOENT","syscall":"spawn /home/getpsyched/git/printer/node_modules/prince/prince/lib/prince/bin/prince","path":"/home/getpsyched/git/printer/node_modules/prince/prince/lib/prince/bin/prince","spawnargs":["--prefix","/home/getpsyched/git/printer/node_modules/prince/prince/lib/prince","dist/question-paper.html","--output","dist/output.pdf"],"cmd":"/home/getpsyched/git/printer/node_modules/prince/prince/lib/prince/bin/prince --prefix /home/getpsyched/git/printer/node_modules/prince/prince/lib/prince dist/question-paper.html --output dist/output.pdf"},"stdout":{"type":"Buffer","data":[]},"stderr":{"type":"Buffer","data":[]}}
at Module.coalesce_to_error (/home/getpsyched/git/printer/node_modules/@sveltejs/kit/src/utils/error.js:9:5)
at Module.handle_fatal_error (/home/getpsyched/git/printer/node_modules/@sveltejs/kit/src/runtime/server/utils.js:72:47)
at resolve (/home/getpsyched/git/printer/node_modules/@sveltejs/kit/src/runtime/server/respond.js:500:17)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Module.respond (/home/getpsyched/git/printer/node_modules/@sveltejs/kit/src/runtime/server/respond.js:274:20)
at async file:///home/getpsyched/git/printer/node_modules/@sveltejs/kit/src/exports/vite/dev/index.js:510:22
Note that I do find the binary installed by the lib at the relative path: node_modules/prince/prince/lib/prince/bin/prince
When I run my application that uses
node-prince
as a dependency, it errors out sayingError: Prince#execute: cannot resolve binary "prince" to a filesystem path
Full error: