Errors while installing packages
steps I followed
npm i -g gatsby-cli
gatsby info
System:
OS: Windows 10
CPU: (8) x64 Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
Binaries:
npm: 6.13.0 - C:\Program Files\nodejs\npm.CMD
Languages:
Python: 2.7.17
Browsers:
Edge: 44.17763.831.0
gatsby new my-awesome-blog https://github.com/gatsbyjs/gatsby-starter-blog
it shows output
info Creating new site from git: https://github.com/gatsbyjs/gatsby-starter-blog.git
Cloning into 'my-awesome-blog'...
remote: Enumerating objects: 15, done.
remote: Counting objects: 100% (15/15), done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 2804 (delta 5), reused 13 (delta 4), pack-reused 2789 eceiving objects: 100% (2804/2804), 11.30 MiB | 747.00 KiB/s
Receiving objects: 100% (2804/2804), 11.58 MiB | 706.00 KiB/s, done.
Resolving deltas: 100% (1769/1769), done.
success Created starter directory layout
info Installing packages...
[email protected] install C:Users\Rutik\my-awesome-blog\node_modules\sharp
(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.8.1/libvips-8.8.1-win32-x64.tar.gz
ERR! sharp Please delete C:Users\RutikAppData\Roaming\npm-cache_libvips\libvips-8.8.1-win32-x64.tar.gz as it is not a valid tarball
ERR! sharp zlib: unexpected end of file
info sharp Attempting to build from source via node-gyp but this may fail due to the above error
info sharp Please see https://sharp.pixelplumbing.com/page/install for required dependencies
C:Users\Rutik\my-awesome-blog\node_modules\sharp>if not defined npm_config_node_gyp (node "C:\usr\local\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\usr\local\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
gyp ERR! find VS
gyp ERR! find VS msvs_version was set from command line or npm config
gyp ERR! find VS - looking for Visual Studio version 2017
gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
gyp ERR! find VS checking VS2017 (15.9.28307.905) found at:
gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools"
gyp ERR! find VS - found "Visual Studio C++ core features"
gyp ERR! find VS - missing any VC++ toolset
gyp ERR! find VS could not find a version of Visual Studio 2017 or newer to use
gyp ERR! find VS looking for Visual Studio 2015
gyp ERR! find VS - not found
gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
gyp ERR! find VS
gyp ERR! find VS valid versions for msvs_version:
gyp ERR! find VS
gyp ERR! find VS *******************
gyp ERR! find VS You need to install the latest version of Visual Studio
gyp ERR! find VS including the "Desktop development with C++" workload.
gyp ERR! find VS For more information consult the documentation at:
gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
gyp ERR! find VS *******************
gyp ERR! find VS
gyp ERR! configure error
gyp ERR! stack Error: Could not find any Visual Studio installation to use
gyp ERR! stack at VisualStudioFinder.fail (C:\usr\local\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:121:47)
gyp ERR! stack at C:\usr\local\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:74:16
gyp ERR! stack at VisualStudioFinder.findVisualStudio2013 (C:\usr\local\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:351:14)
gyp ERR! stack at C:\usr\local\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:70:14
gyp ERR! stack at C:\usr\local\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:372:16
gyp ERR! stack at C:\usr\local\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7
gyp ERR! stack at C:\usr\local\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16
gyp ERR! stack at ChildProcess.exithandler (child_process.js:302:5)
gyp ERR! stack at ChildProcess.emit (events.js:210:5)
gyp ERR! stack at maybeClose (internal/child_process.js:1021:16)
gyp ERR! System Windows_NT 10.0.17763
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\usr\local\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:Users\Rutik\my-awesome-blog\node_modules\sharp
gyp ERR! node -v v12.13.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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! C:Users\RutikAppData\Roaming\npm-cache_logs\2019-11-15T16_44_21_212Z-debug.log
ERROR
Command failed with exit code 1 (Unknown system error -1): npm install
Error: Command failed with exit code 1 (Unknown system error -1): npm install
error.js:59 makeError
[npm]/[gatsby-cli]/[execa]/lib/error.js:59:11
index.js:112 handlePromise
[npm]/[gatsby-cli]/[execa]/index.js:112:26
task_queues.js:93 processTicksAndRejections
internal/process/task_queues.js:93:5
It should have installed successfully so that i can run gatsby develop
but result was full of errors mentioned above. none of the documentation have any informatio regarding this issue. i need help.
So it looks like this is an issue with your system and sharp specifically. The install directions on their repo might be of help?
https://github.com/lovell/sharp/blob/master/docs/install.md
I'm not sure if there is anything gatsby can do to make this more obvious or easier. Would definitely be interested in solving this edge case if we could find a predictable fix in our own codebase.
Can you try and do a yarn add sharp and see if it works? or npm install sharp
So it looks like this is an issue with your system and
sharpspecifically. The install directions on their repo might be of help?https://github.com/lovell/sharp/blob/master/docs/install.md
I'm not sure if there is anything gatsby can do to make this more obvious or easier. Would definitely be interested in solving this edge case if we could find a predictable fix in our own codebase.
Can you try and do a
yarn add sharpand see if it works? ornpm install sharp
I tried this .but didn't worked. yarn is installed successfully. also added sharp successfully by yarn add sharp. But still it shows same errors.
[4/4] Building fresh packages...
[6/10] â mozjpeg
[7/10] â pngquant-bin
[9/10] â cwebp-bin
[10/10] â oniguruma
error C:Users\Rutik\bblog\node_modules\oniguruma: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments:
Directory: C:Users\Rutik\bblog\node_modules\oniguruma
Output:
C:Users\Rutik\bblog\node_modules\oniguruma>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "" rebuild )
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | win32 | x64
gyp info find Python using Python version 2.7.17 found at "C:\Python27\python.exe"
gyp ERR! find VS
gyp ERR! find VS msvs_version was set from command line or npm config
gyp ERR! find VS - looking for Visual Studio version 2017
gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
gyp ERR! find VS checking VS2017 (15.9.28307.905) found at:
gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools"
gyp ERR! find VS - found "Visual Studio C++ core features"
gyp ERR! find VS - missing any VC++ toolset
gyp ERR! find VS could not find a version of Visual Studio 2017 or newer to use
gyp ERR! find VS looking for Visual Studio 2015
gyp ERR! find VS - not found
gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
gyp ERR! find VS
gyp ERR! find VS valid versions for msvs_version:
gyp ERR! find VS
gyp ERR! find VS *******************
gyp ERR! find VS You need to install the latest version of Visual Studio
gyp ERR! find VS including the "Desktop development with C++" workload.
gyp ERR! find VS For more information consult the documentation at:
gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
gyp ERR! find VS *******************
gyp ERR! find VS
gyp ERR! configure error
gyp ERR! stack Error: Could not find any Visual Studio installation to use
gyp ERR! stack at VisualStudioFinder.fail (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:121:47)
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:74:16
gyp ERR! stack at VisualStudioFinder.findVisualStudio2013 (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:351:14)
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:70:14
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:372:16
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16
gyp ERR! stack at ChildProcess.exithandler (child_process.js:302:5)
gyp ERR! stack at ChildProcess.emit (events.js:210:5)
gyp ERR! stack at maybeClose (internal/child_process.js:1021:16)
gyp ERR! System Windows_NT 10.0.17763
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"
gyp ERR! cwd C:Users\Rutik\bblog\node_modules\oniguruma
ERROR
Command failed with exit code 1 (Unknown system error -1): yarnpkg
Error: Command failed with exit code 1 (Unknown system error -1): yarnpkg
error.js:59 makeError
[npm]/[gatsby-cli]/[execa]/lib/error.js:59:11
index.js:112 handlePromise
[npm]/[gatsby-cli]/[execa]/index.js:112:26
task_queues.js:93 processTicksAndRejections
internal/process/task_queues.js:93:5
This was an issue regarding installing node-gyp on windows. It took a lot of frustration and effort but finally I fixed this issue.
This article helped a lot in the process.check this if you are facing the same issue.
https://spin.atomicobject.com/2019/03/27/node-gyp-windows/
I am closing this issue now as it is not related to gatsby.
Most helpful comment
This was an issue regarding installing node-gyp on windows. It took a lot of frustration and effort but finally I fixed this issue.
This article helped a lot in the process.check this if you are facing the same issue.
https://spin.atomicobject.com/2019/03/27/node-gyp-windows/
I am closing this issue now as it is not related to gatsby.