Gottox / node-pdfutils

tool for analyzing and converting PDF
103 stars 23 forks source link

Error installing on node 0.12 #23

Open mhkeller opened 9 years ago

mhkeller commented 9 years ago

I installed poppler per the brew instructions but I get this when installing. My version of node-gyp is 1.0.3

> node-gyp rebuild

child_process: customFds option is deprecated, use stdio instead.
  CXX(target) Release/obj.target/pdfutils/src/document.o
In file included from ../src/document.cc:11:
In file included from ../src/document.h:7:
../src/page.h:10:27: error: expected class name
class Page : public node::ObjectWrap {
                          ^
../src/page.h:24:83: error: no type named 'AccessorInfo' in namespace 'v8'
  ...static v8::Handle<v8::Value> GetLinks(v8::Local<v8::String> property, const v8::Access...
                                                                                 ~~~~^
../src/page.h:26:48: error: no type named 'Arguments' in namespace 'v8'; did you mean
      'v8::internal::Arguments'?
                static v8::Handle<v8::Value> ConvertTo(const v8::Arguments& args);
                                                             ^~~~~~~~~~~~~
                                                             v8::internal::Arguments
~/.node-gyp/0.12.0/deps/v8/include/v8.h:127:7: note:
      'v8::internal::Arguments' declared here
class Arguments;
      ^
In file included from ../src/document.cc:11:
In file included from ../src/document.h:8:
../src/page_job.h:18:30: error: expected class name
class PageJob : public node::ObjectWrap {
                             ^
../src/page_job.h:32:3: error: unknown type name 'uv_mutex_t'
                uv_mutex_t chunkMutex;
                ^
../src/page_job.h:34:3: error: unknown type name 'uv_async_t'
                uv_async_t message_finished;
                ^
../src/page_job.h:35:3: error: unknown type name 'uv_async_t'
                uv_async_t message_chunk;
                ^
../src/page_job.h:42:30: error: unknown type name 'uv_async_t'
                static void ChunkCompleted(uv_async_t* handle, int status);
                                           ^
../src/page_job.h:43:28: error: unknown type name 'uv_async_t'
                static void JobCompleted(uv_async_t* handle, int status);
                                         ^
../src/page_job.h:44:87: error: no type named 'AccessorInfo' in namespace 'v8'
  ...v8::Handle<v8::Value> GetDimension(v8::Local<v8::String> property, const v8::AccessorI...
                                                                              ~~~~^
In file included from ../src/document.cc:11:
../src/document.h:20:31: error: expected class name
class Document : public node::ObjectWrap {
                              ^
../src/document.h:31:3: error: unknown type name 'uv_mutex_t'
                uv_mutex_t jobMutex;
                ^
../src/document.h:33:3: error: unknown type name 'uv_mutex_t'
                uv_mutex_t stateMutex;
                ^
../src/document.h:35:3: error: unknown type name 'uv_work_t'
                uv_work_t worker;
                ^
../src/document.h:45:42: error: no type named 'Arguments' in namespace 'v8'; did you mean
      'v8::internal::Arguments'?
                static v8::Handle<v8::Value> New(const v8::Arguments& args);
                                                       ^~~~~~~~~~~~~
                                                       v8::internal::Arguments
~/.node-gyp/0.12.0/deps/v8/include/v8.h:127:7: note:
      'v8::internal::Arguments' declared here
class Arguments;
      ^
In file included from ../src/document.cc:11:
../src/document.h:48:82: error: no type named 'AccessorInfo' in namespace 'v8'
  ...static v8::Handle<v8::Value> GetPage(v8::Local<v8::String> property, const v8::Accesso...
                                                                                ~~~~^
../src/document.h:49:30: error: unknown type name 'uv_work_t'
                static void BackgroundLoad(uv_work_t* req);
                                           ^
../src/document.h:50:32: error: unknown type name 'uv_work_t'
                static void BackgroundLoaded(uv_work_t* req);
                                             ^
../src/document.h:52:22: error: unknown type name 'uv_work_t'
                static void Worker(uv_work_t *handle);
                                   ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [Release/obj.target/pdfutils/src/document.o] Error 1
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:267:23)
gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1067:12)
gyp ERR! System Darwin 13.4.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! node -v v0.12.0
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok
npm ERR! Darwin 13.4.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "--save" "pdfutils"
npm ERR! node v0.12.0
npm ERR! npm  v2.5.1
npm ERR! code ELIFECYCLE

npm ERR! pdfutils@0.3.2 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the pdfutils@0.3.2 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the pdfutils package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls pdfutils
npm ERR! There is likely additional logging output above.
Gottox commented 9 years ago

node-pdfutils must be ported to NAN to make this work.

mhkeller commented 9 years ago

Is this in the roadmap? It would be great to use this on my updated system.

iboozyvoozy commented 9 years ago

+1 Maybe someone know another solution to generate pdf preview?

antoniobrandao commented 9 years ago

+1

brianconnoly commented 8 years ago

+100500 Anyone know alternatives for redreting pdf to png in nodejs?

antoniobrandao commented 8 years ago

@brianconnoly I use imagemagick, installed in the host machine. Using the command "convert", it works fine and has many options. I also use the node module "pdfinfo" to get info from the PDF before processing it.