tojocky / node-printer

Native node.js printer
1.54k stars 443 forks source link

Try to use electron-builder pack x64 windows exe failed #250

Open panda6412 opened 5 years ago

panda6412 commented 5 years ago

Have anyone tried using Electron 4.0.0 with node-printer successfully before ?

I follow the README.md npm install printer --runtime=electron --target=4.0.0 --target_arch=x64

But got below fail log, could anyone help me figure out what the things happened exactly!

1707017NB01-4:electron-react yang$ npm install printer --runtime=electron --target=4.0.0 --target_arch=x64

> printer@0.2.2 install /Users/yang/Desktop/electron_practice/electron-react/node_modules/printer
> node-gyp rebuild

gyp WARN EACCES user "yang" does not have permission to access the dev dir "/Users/yang/.node-gyp/4.0.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/var/folders/r2/qqgrgxkx2pb4dg348hlzmd1m0000gn/T/.node-gyp"
  CXX(target) Release/obj.target/node_printer/src/node_printer_posix.o
warning: include path for stdlibc++ headers not found; pass '-stdlib=libc++' on the command
      line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
In file included from ../src/node_printer_posix.cc:1:
../src/node_printer.hpp:9:10: fatal error: 'string' file not found
#include <string>
         ^~~~~~~~
1 warning and 1 error generated.
make: *** [Release/obj.target/node_printer/src/node_printer_posix.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:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:189:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Darwin 18.2.0
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 /Users/yang/Desktop/electron_practice/electron-react/node_modules/printer
gyp ERR! node -v v10.15.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
npm WARN @typescript-eslint/eslint-plugin@1.6.0 requires a peer of typescript@* but none is installed. You must install peer dependencies yourself.
npm WARN @typescript-eslint/parser@1.6.0 requires a peer of typescript@* but none is installed. You must install peer dependencies yourself.
npm WARN @typescript-eslint/typescript-estree@1.6.0 requires a peer of typescript@* but none is installed. You must install peer dependencies yourself.
npm WARN react-electron-web-view@2.0.1 requires a peer of react@^15.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-electron-web-view@2.0.1 requires a peer of react-dom@^15.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN ts-pnp@1.1.2 requires a peer of typescript@* but none is installed. You must install peer dependencies yourself.
npm WARN tsutils@3.10.0 requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev but none is installed. You must install peer dependencies yourself.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! printer@0.2.2 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the printer@0.2.2 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/yang/.npm/_logs/2019-05-30T03_23_40_376Z-debug.log
lucaspedronet commented 5 years ago

@panda6412 Did you solve this problem? is also rushing the same error message to me. help @tojocky

panda6412 commented 5 years ago

@panda6412 Did you solve this problem? is also rushing the same error message to me. help @tojocky

Try to downgrade node version, I mean try every of version

ekoeryanto commented 5 years ago

just add --build-from-source options.