Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install gatsby-transformer-sharp #19709

Closed
Erbenos opened this issue Nov 21, 2019 · 3 comments
Closed

Unable to install gatsby-transformer-sharp #19709

Erbenos opened this issue Nov 21, 2019 · 3 comments

Comments

@Erbenos
Copy link

Erbenos commented Nov 21, 2019

Description

My env:

Windows 10 Pro
npm version 6.13.1
node version 13.2.0

I have proper windows build tools setup.

Steps to reproduce

npm i --save gatsby-transformer-sharp

Expected result

Package installs.

Actual result

PS C:\Work Projects\cesko-digital-blog\blog> npm i --save gatsby-transformer-sharp@latest

> sharp@0.21.3 install C:\Work Projects\cesko-digital-blog\blog\node_modules\sharp> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)

info sharp Using cached C:\Users\mfoltyn\AppData\Roaming\npm-cache\_libvips\libvips-8.7.0-win32-x64.tar.gz
info sharp Creating C:\Work Projects\cesko-digital-blog\blog\node_modules\sharp\build\Release
info sharp Copying DLLs from C:\Work Projects\cesko-digital-blog\blog\node_modules\sharp\vendor\lib to C:\Work Projects\cesko-digital-blog\blog\node_modules\sharp\build\Release
prebuild-install WARN install No prebuilt binaries found (target=13.2.0 runtime=node arch=x64 libc= platform=win32)

C:\Work Projects\cesko-digital-blog\blog\node_modules\sharp>if not defined npm_config_node_gyp (node "c:\Users\mfoltyn\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "c:\Users\mfoltyn\AppData\Roaming\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild ) 
←[37;40mgyp←[0m ←[0m←[31;40mERR!←[0m ←[0m←[35mUNCAUGHT EXCEPTION←[0m 
←[0m←[37;40mgyp←[0m ←[0m←[31;40mERR!←[0m ←[0m←[35mstack←[0m Error: spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe ENOENT
←[0m←[37;40mgyp←[0m ←[0m←[31;40mERR!←[0m ←[0m←[35mstack←[0m     at Process.ChildProcess._handle.onexit (internal/child_process.js:262:19)
←[0m←[37;40mgyp←[0m ←[0m←[31;40mERR!←[0m ←[0m←[35mstack←[0m     at onErrorNT (inte←[0m←[37;40mgyp←[0m ←[0m←[31;40mERR!←[0m ←[0m←[35mstack←[0m     at processTicksAnd←[0m←[37;40mgyp←[0m ←[0m←[31;40mERR!←[0m ←[0m←[35mSystem←[0m Windows_NT 10.0.19013
←[0m←[37;40mgyp←[0m ←[0m←[31;40mERR!←[0m ←[0m←[35mcommand←[0m "C:\\Program Files\\nodejs\\node.exe" "c:\\Users\\mfoltyn\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
←[0m←[37;40mgyp←[0m ←[0m←[31;40mERR!←[0m ←[0m←[35mcwd←[0m C:\Work Projects\cesko-digital-blog\blog\node_modules\sharp
←[0m←[37;40mgyp←[0m ←[0m←[31;40mERR!←[0m ←[0m←[35mnode -v←[0m v13.2.0
←[0m←[37;40mgyp←[0m ←[0m←[31;40mERR!←[0m ←[0m←[35mnode-gyp -v←[0m v6.0.1
←[0m←[37;40mgyp←[0m ←[0m←[31;40mERR!←[0m←[35m←[0m This is a bug in `node-gyp`.    
←[0m←[37;40mgyp←[0m ←[0m←[31;40mERR!←[0m←[35m←[0m Try to update node-gyp and file 
an Issue if it does not help:
←[0m←[37;40mgyp←[0m ←[0m←[31;40mERR!←[0m←[35m←[0m     <https://github.com/nodejs/node-gyp/issues>
←[0m[            ......] - install: info lifecycle sharp@0.21.3~install: Failed tonpm WARN rollback Rolling back readable-stream@2.3.6 failed (this is probably harmless): EPERM: operation not permitted, rmdir 'C:\Work Projects\cesko-digital-blog\blog\node_modules\fsevents\node_modules'
npm WARN eslint-config-react-app@5.0.2 requires a peer of eslint@6.x but none is installed. You must install peer dependencies yourself.
npm WARN tsutils@3.17.1 requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.
npm WARN gatsby-starter-multiple-author@1.1.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})   
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.2 (node_modules\gatsby\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})   
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.2 (node_modules\gatsby-page-utils\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})   

npm ERR! code ELIFECYCLE
npm ERR! errno 7
npm ERR! sharp@0.21.3 install: `(node install/libvips && node install/dll-copy && 
prebuild-install) || (node-gyp rebuild && node install/dll-copy)`
npm ERR! Exit status 7
npm ERR!
npm ERR! Failed at the sharp@0.21.3 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\mfoltyn\AppData\Roaming\npm-cache\_logs\2019-11-21T23_18_25_851Z-debug.log

After a bit of looking around... can the case be older sharp version dependency? Maybe 0.21.3 doesn't have prebuild binaries for my Node version. Not sure why 0.21.3 is being requested anyway, because after looking at gatsby-transformer-sharp package.json, there is ^0.23.2 specified. I am a bit lost.

@bitttttten
Copy link

bitttttten commented Nov 23, 2019

You have an issue with node-gyp. Windows and node-gyp can fail to install for difference reasons (it even says it in the docs: "you're running into dreaded node-gyp issues and have no idea what's going on." 😅 ).

In your logs it says

This is a bug in node-gyp.
Try to update node-gyp and file an Issue if it does not help:
https://github.com/nodejs/node-gyp/issues

You might find more help in https://github.com/nodejs/node-gyp, or even in this thread: nodejs/node-gyp#1753

Make sure you have all the requirements for node-gyp too: https://github.com/nodejs/node-gyp#on-windows

Before following the above links or trying anything anyone recommends, do read through it all first and try to understand what the commands are doing. Debugging node-gyp issues on Windows is a real pain and sometimes you can hurt yourself by copy and pasting things from a random Github issue :)

@Erbenos
Copy link
Author

Erbenos commented Nov 23, 2019

I was hoping there is something package-specific going on. I will pull out my hair with node-gyp for a while.

@Erbenos Erbenos closed this as completed Nov 23, 2019
@Erbenos
Copy link
Author

Erbenos commented Nov 23, 2019

I tried again with yarn. Yarn successfully installs the package, npm does not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants