NickNaso / ghostscript4js

Ghostscript4JS binds the Ghostscript C API to the Node.JS world.
http://www.nacios.it
Apache License 2.0
66 stars 19 forks source link

Install failing #64

Closed peterzanetti closed 3 years ago

peterzanetti commented 3 years ago

Hello, I am trying to install on Amazon Linux 2 and have followed the prerequisites. This is the error when installing:

ghostscript4js@3.2.1 install /home/ec2-user/fileshare/node_modules/ghostscript4js node-gyp rebuild

make: Entering directory /home/ec2-user/fileshare/node_modules/ghostscript4js/build' CC(target) Release/obj.target/nothing/../node-addon-api/src/nothing.o make: cc: Command not found make: *** [Release/obj.target/nothing/../node-addon-api/src/nothing.o] Error 127 make: Leaving directory/home/ec2-user/fileshare/node_modules/ghostscript4js/build' gyp ERR! build error gyp ERR! stack Error: make failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:191:23) gyp ERR! stack at ChildProcess.emit (events.js:198:13) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12) gyp ERR! System Linux 4.14.203-156.332.amzn2.x86_64 gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /home/ec2-user/fileshare/node_modules/ghostscript4js gyp ERR! node -v v10.24.0 gyp ERR! node-gyp -v v5.1.0 gyp ERR! not ok

NickNaso commented 3 years ago

Hi @peterzanetti, from the error seems that you need to install all the toolchain to compile C / C++ code on your linux machine like make and gcc. I found this guide https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/compile-software.html I hope that this help you. Let meknow if this solve your problem.

peterzanetti commented 3 years ago

Thank you for that suggestion. I have installed the build tools and it looks I get a new error now:

make: Entering directory /home/ec2-user/fileshare/node_modules/ghostscript4js/build' CC(target) Release/obj.target/nothing/../node-addon-api/src/nothing.o AR(target) Release/obj.target/../node-addon-api/src/nothing.a COPY Release/nothing.a CXX(target) Release/obj.target/ghostscript4js/src/ghostscript4js.o SOLINK_MODULE(target) Release/obj.target/ghostscript4js.node g++: error: /usr/lib/x86_64-linux-gnu/libgs.so: No such file or directory make: *** [Release/obj.target/ghostscript4js.node] Error 1 make: Leaving directory/home/ec2-user/fileshare/node_modules/ghostscript4js/build' gyp ERR! build error gyp ERR! stack Error: make failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:191:23) gyp ERR! stack at ChildProcess.emit (events.js:198:13) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12) gyp ERR! System Linux 4.14.203-156.332.amzn2.x86_64 gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /home/ec2-user/fileshare/node_modules/ghostscript4js gyp ERR! node -v v10.24.0 gyp ERR! node-gyp -v v5.1.0 gyp ERR! not ok

peterzanetti commented 3 years ago

I am able to find /usr/lib64/libgs.so on this system, so I assume there is an issue with nonexistence of /usr/lib/x86_64-linux-gnu/libgs.so ?

NickNaso commented 3 years ago

Could you try to create a symbolic link ln -s /usr/lib64/libgs.so /usr/lib/x86_64-linux-gnu/libgs.so and the try to install?

peterzanetti commented 3 years ago

Actually what I did was create a global ENV by creating this file: /etc/profiles.d/ghost.sh export GS4JS_HOME="/usr/lib64"

Then I was able to install successfully.

Thank you for your help!

NickNaso commented 3 years ago

I'm closing the issue because it seems that you solved the problem. Feel free to reopen in case you continue to have the same problem.