Veronika Vrana
Veronika Vrana

Reputation: 152

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?

Upvotes: 0

Views: 554

Answers (1)

Abdelrhman Mohamed
Abdelrhman Mohamed

Reputation: 195

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

Upvotes: 1

Related Questions