简体   繁体   中英

Nodejs project failed to find ghostscript installed with Chocolatey

I am editing a Node.js application which requires Ghostscript. I installed Ghostscript using Chocolatey in admin PowerShell: choco install ghostscript . The installation completed successfully and the package is located in C:\ProgramData\chocolatey.chocolatey\Ghostscript.9.55.0.

But when I run the application (locally from VS code), it throws an error Command failed: gm identify: Failed to find Ghostscript (not installed?).

Do I need to adjust some path so that Node.js knows where to look for the package?

because node.js searching for Ghostscript in node_modules folder and it's actually not there.

now the solution is to install it in node.js via npm

npm i ghostscript4js

Package description: This module binds the Ghostscript C API to bring its power to the Node.JS world

Read more on its official docs here ghostscript4js npm Or Github repository

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM