rawnly / splash-cli

A simple, CLI to download Unsplash wallpapers. Nothing fancy — it just works.
http://splash-cli.app?ref=github
546 stars 28 forks source link

Installation in Windows needs Visual Studio Installation? #89

Closed reaseno closed 3 years ago

reaseno commented 3 years ago

I tried to install splash-cli on fresh installation and get this:

npm WARN deprecated core-js@2.6.12: 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! code 1
npm ERR! path C:\Users\User\AppData\Roaming\npm\node_modules\splash-cli\node_modules\sharp
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c (node install/libvips && node install/dll-copy && prebuild-install --runtime=napi) || (node-gyp rebuild && node install/dll-copy)
npm ERR! info sharp Using cached C:\Users\User\AppData\Local\npm-cache\_libvips\libvips-8.9.1-win32-x64.tar.gz
npm ERR! info sharp Creating C:\Users\User\AppData\Roaming\npm\node_modules\splash-cli\node_modules\sharp\build\Release
npm ERR! info sharp Copying DLLs from C:\Users\User\AppData\Roaming\npm\node_modules\splash-cli\node_modules\sharp\vendor\lib to C:\Users\User\AppData\Roaming\npm\node_modules\splash-cli\node_modules\sharp\build\Release
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@15.8.0 | win32 | x64
npm ERR! gyp info find Python using Python version 3.9.1 found at "C:\Program Files\Python39\python.exe"
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS msvs_version was set from command line or npm config
npm ERR! gyp ERR! find VS - looking for Visual Studio version 2017
npm ERR! gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
npm ERR! gyp ERR! find VS checking VS2019 (16.8.31005.135) found at:
npm ERR! gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community"
npm ERR! gyp ERR! find VS - "Visual Studio C++ core features" missing
npm ERR! gyp ERR! find VS could not find a version of Visual Studio 2017 or newer to use
npm ERR! gyp ERR! find VS looking for Visual Studio 2015
npm ERR! gyp ERR! find VS - not found
npm ERR! gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS valid versions for msvs_version:
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS You need to install the latest version of Visual Studio
npm ERR! gyp ERR! find VS including the "Desktop development with C++" workload.
npm ERR! gyp ERR! find VS For more information consult the documentation at:
npm ERR! gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Could not find any Visual Studio installation to use

How can it be that splash-cli needs Visual Studio to be installed? Seems a bit overkill with 2GB of installation. Or what did I wrong?

reaseno commented 3 years ago

The last version installable is with: npm install --global splash-cli@3.4.12

But there the --day parameter does not work.

rawnly commented 3 years ago

Hi @reaseno, from your trace seems that sharp needs C to be installed npm ERR! path C:\Users\User\AppData\Roaming\npm\node_modules\splash-cli\node_modules\sharp

But there the --day parameter does not work.

Can you post a log?

rawnly commented 3 years ago

Sharp has been introduced in v3.4.13 so if you don't want to install VS (that is reasonable) you have to use v3.4.12 or below.

Please take a look at sharp#598

reaseno commented 3 years ago

I have retried the --day parameter in version 3.4.12. It worked. Maybe a temporary internet problem.

sharp seems a bit strange. Haven't found a solution without VS installation. I wondered as I thought I had installed it in my previous Windows 10 installation. Need to reinstall that old image.

Thank you for your help.

reaseno commented 3 years ago

Yes, I had 3.4.15 installed in my old Windows 10. After downgrading to 3.4.12 and back to 3.4.15 I have the same problem with dependencies. Since it didn't exist the last time I installed 3.4.15, it seems that the dependencies have been changed.