lwille/node-gphoto2

Windows support

Maxou44 opened this issue · 6 comments

Do you think it's possible to support Windows ?

Maybe; at least you can try building libgphoto2 on Windows.

Hi guys, I would really appreciate some help. I found a way to install libgphoto2 on Windows 10. I can execute successfully gphoto2 --auto-detect.

When capturing an image from a cmd prompt with gphoto2 --capture-image-and-download it works as expected and I can find my picture on my disk.

The problem is I can't find a way to install this lib, when doing npm i gphoto2 I got all these errors and I don't know how to solve them. Any clue?

npm i gphoto2

npm ERR! prepareGitDep 1>
npm ERR! prepareGitDep > gphoto2@0.3.2 preinstall C:\Users\photobox\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-b1f197b9
npm ERR! prepareGitDep > ((which pkg-config && pkg-config libgphoto2) || (which dpkg && (dpkg -s libgphoto2-dev || dpkg -s libgphoto2-6-dev)) || (which brew && brew list libgphoto2) || (echo 'ERROR: libgphoto2 seems not to be installed.' 1>&2; exit 1))
npm ERR! prepareGitDep
npm ERR! prepareGitDep
npm ERR! prepareGitDep > pre-commit@1.2.2 install C:\Users\photobox\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-b1f197b9\node_modules\pre-commit
npm ERR! prepareGitDep > node install.js
npm ERR! prepareGitDep
npm ERR! prepareGitDep
npm ERR! prepareGitDep > core-js@2.6.11 postinstall C:\Users\photobox\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-b1f197b9\node_modules\core-js
npm ERR! prepareGitDep > node -e "try{require('./postinstall')}catch(e){}"
npm ERR! prepareGitDep
npm ERR! prepareGitDep Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
npm ERR! prepareGitDep
npm ERR! prepareGitDep The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
npm ERR! prepareGitDep > https://opencollective.com/core-js
npm ERR! prepareGitDep > https://www.patreon.com/zloirock
npm ERR! prepareGitDep
npm ERR! prepareGitDep Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
npm ERR! prepareGitDep
npm ERR! prepareGitDep
npm ERR! prepareGitDep > spawn-sync@1.0.15 postinstall C:\Users\photobox\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-b1f197b9\node_modules\spawn-sync
npm ERR! prepareGitDep > node postinstall
npm ERR! prepareGitDep
npm ERR! prepareGitDep
npm ERR! prepareGitDep > gphoto2@0.3.2 install C:\Users\photobox\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-b1f197b9
npm ERR! prepareGitDep > node-gyp rebuild
npm ERR! prepareGitDep
npm ERR! prepareGitDep
npm ERR! prepareGitDep C:\Users\photobox\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-b1f197b9>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
npm ERR! prepareGitDep Les projets sont g�n�r�s individuellement dans cette solution. Pour activer la g�n�ration en parall�le, ajoutez le commutateur "/m".
npm ERR! prepareGitDep   autodetect.cc
npm ERR! prepareGitDep   binding.cc
npm ERR! prepareGitDep   camera.cc
npm ERR! prepareGitDep   camera_helpers.cc
npm ERR! prepareGitDep c:\users\photobox\appdata\roaming\npm-cache\_cacache\tmp\git-clone-b1f197b9\src\autodetect.cc(3): fatal error C1083: Impossible d'ouvrir le fichier include�: 'gphoto2/gphoto2-camera.h'�: No such file or directory [C:\Users\photobox\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-b1f197b9\build\gphoto2.vcxproj]
npm ERR! prepareGitDep c:\users\photobox\appdata\roaming\npm-cache\_cacache\tmp\git-clone-b1f197b9\src\camera.cc(3): fatal error C1083: Impossible d'ouvrir le fichier include�: 'gphoto2/gphoto2-widget.h'�: No such file or directory [C:\Users\photobox\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-b1f197b9\build\gphoto2.vcxproj]
npm ERR! prepareGitDep   gphoto.cc
npm ERR! prepareGitDep c:\users\photobox\appdata\roaming\npm-cache\_cacache\tmp\git-clone-b1f197b9\src\camera_helpers.cc(4): fatal error C1083: Impossible d'ouvrir le fichier include�: 'sys/socket.h'�: No such file or directory [C:\Users\photobox\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-b1f197b9\build\gphoto2.vcxproj]
npm ERR! prepareGitDep   win_delay_load_hook.cc
npm ERR! prepareGitDep c:\users\photobox\appdata\roaming\npm-cache\_cacache\tmp\git-clone-b1f197b9\src\binding.h(7): fatal error C1083: Impossible d'ouvrir le fichier include�: 'gphoto2/gphoto2-camera.h'�: No such file or directory (compilation du fichier source ..\src\binding.cc) [C:\Users\photobox\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-b1f197b9\build\gphoto2.vcxproj]
npm ERR! prepareGitDep c:\users\photobox\appdata\roaming\npm-cache\_cacache\tmp\git-clone-b1f197b9\src\binding.h(7): fatal error C1083: Impossible d'ouvrir le fichier include�: 'gphoto2/gphoto2-camera.h'�: No such file or directory (compilation du fichier source ..\src\gphoto.cc) [C:\Users\photobox\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-b1f197b9\build\gphoto2.vcxproj]
npm ERR! prepareGitDep
npm ERR! prepareGitDep 2> npm WARN install Usage of the `--dev` option is deprecated. Use `--only=dev` instead.
npm ERR! prepareGitDep 'which' n'est pas reconnu en tant que commande interne
npm ERR! prepareGitDep ou externe, un programme ex�cutable ou un fichier de commandes.
npm ERR! prepareGitDep 'which' n'est pas reconnu en tant que commande interne
npm ERR! prepareGitDep ou externe, un programme ex�cutable ou un fichier de commandes.
npm ERR! prepareGitDep 'which' n'est pas reconnu en tant que commande interne
npm ERR! prepareGitDep ou externe, un programme ex�cutable ou un fichier de commandes.
npm ERR! prepareGitDep 'ERROR: libgphoto2 seems not to be installed.' ; exit 1
npm ERR! prepareGitDep npm WARN deprecated mkdirp@0.5.1: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm ERR! prepareGitDep npm WARN deprecated core-js@2.6.11: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm ERR! prepareGitDep gyp ERR! build error
npm ERR! prepareGitDep gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
npm ERR! prepareGitDep gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
npm ERR! prepareGitDep gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
npm ERR! prepareGitDep gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
npm ERR! prepareGitDep gyp ERR! System Windows_NT 10.0.18363
npm ERR! prepareGitDep gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! prepareGitDep gyp ERR! cwd C:\Users\photobox\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-b1f197b9
npm ERR! prepareGitDep gyp ERR! node -v v12.18.2
npm ERR! prepareGitDep gyp ERR! node-gyp -v v5.1.0
npm ERR! prepareGitDep gyp ERR! not ok
npm ERR! prepareGitDep npm ERR! code ELIFECYCLE
npm ERR! prepareGitDep npm ERR! errno 1
npm ERR! prepareGitDep npm ERR! gphoto2@0.3.2 install: `node-gyp rebuild`
npm ERR! prepareGitDep npm ERR! Exit status 1
npm ERR! prepareGitDep npm ERR!
npm ERR! prepareGitDep npm ERR! Failed at the gphoto2@0.3.2 install script.
npm ERR! prepareGitDep npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! prepareGitDep
npm ERR! prepareGitDep npm ERR! A complete log of this run can be found in:
npm ERR! prepareGitDep npm ERR!     C:\Users\photobox\AppData\Roaming\npm-cache\_logs\2020-07-07T15_56_42_590Z-debug.log
npm ERR! prepareGitDep
npm ERR! premature close

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\photobox\AppData\Roaming\npm-cache\_logs\2020-07-07T15_56_43_027Z-debug.log

Thanks in advance

Sorry, this somehow got buried - your log indicates that MSBuild.exe failed with exit code: 1.
There's no further log output by that program to tell us why it failed. Did you manage to make any progress on this, @boutils?

Nope unfortunately, I switched to digiCamControl.

Closing this old feature request; feel free to reopen if somebody finds the time to suggest an implementation.

@boutils thanks for the suggestion, it is very convenient with the built-in webserver