When building for local development gatsby-transformer-sharp halts the process
Stack trace:
error Plugin gatsby-transformer-sharp returned an error
Error: dlopen(/Users/pedro/Projects/3Decide/int_alivevision_website/node_modules/gatsby-plugin-sharp/node_modules/sharp/build/Release/sharp.node, 1): Library not loaded: @rpath /libvips.42.dylib
Referenced from: /Users/pedro/Projects/3Decide/int_alivevision_website/node_modules/gatsby-plugin-sharp/node_modules/sharp/vendor/lib/libvips-cpp.42.dylib
Reason: Incompatible library version: libvips-cpp.dylib requires version 52.0.0 or later, but libvips.42.dylib provides version 51.0.0
gatsby- starter-default download , install gatsby-transformer-sharp , gatsby-plugin-sharp and gatsby-image. With the environment below can't compile.
had to build from source grpc to install sharp (when installing the plugin), or else installation would fail.
Should compile in development mode
Compilation process breaks
System:
OS: macOS 10.14
CPU: x64 Intel(R) Core(TM) i7-3615QM CPU @ 2.30GHz
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 11.0.0 - /usr/local/bin/node
npm: 6.4.1 - /usr/local/bin/npm
Browsers:
Chrome: 70.0.3538.77
Firefox: 60.0.2
Safari: 12.0
npmPackages:
gatsby: 2.0.0 => 2.0.0
gatsby-image: ^2.0.19 => 2.0.19
gatsby-plugin-manifest: 2.0.2 => 2.0.2
gatsby-plugin-offline: 2.0.5 => 2.0.5
gatsby-plugin-react-helmet: 3.0.0 => 3.0.0
gatsby-plugin-sass: 2.0.1 => 2.0.1
gatsby-plugin-sharp: ^2.0.11 => 2.0.11
gatsby-plugin-typography: ^2.2.0 => 2.2.0
gatsby-source-filesystem: 2.0.1 => 2.0.1
gatsby-transformer-json: 2.1.2 => 2.1.2
gatsby-transformer-remark: 2.1.3 => 2.1.3
gatsby-transformer-sharp: ^2.1.7 => 2.1.7
npmGlobalPackages:
gatsby-cli: 2.4.4
This is probably duplicate of #9533
You need gatsby 2.0.33 or later. (^2.0.33)
updated to Gatsby 2.038.
Now I can compile but still get this error:
error Plugin gatsby-transformer-sharp returned an error
Error: dlopen(/Users/pedro/Projects/3Decide/int_alivevision_website/node_modules/gatsby-plugin-sharp/node_modules/sharp/build/Release/sharp.node, 1): Li brary not loaded: @rpath/libvips.42.dylib
Referenced from: /Users/pedro/Projects/3Decide/int_alivevision_website/node_modules/gatsby-plugin-sharp/node_modules/sharp/vendor/lib/libvips-cpp.42.d ylib
Reason: Incompatible library version: libvips-cpp.dylib requires version 52.0.0 or later, but libvips.42.dylib provides version 51.0.0
Even though I can compile I assume I won't be able to run gatsby-transformer-sharp with success.
My gatsby-config.js
module.exports = {
siteMetadata: {
title: 'alive vision',
},
plugins: [
'gatsby-plugin-react-helmet',
{
resolve: gatsby-plugin-manifest,
options: {
name: 'gatsby-starter-default',
short_name: 'starter',
start_url: '/',
background_color: '#663399',
theme_color: '#663399',
display: 'minimal-ui',
icon: 'src/images/gatsby-icon.png', // This path is relative to the root of the site.
},
},
'gatsby-transformer-sharp',
'gatsby-plugin-sharp',
'gatsby-plugin-offline',
gatsby-plugin-sass,
gatsby-transformer-remark,
gatsby-transformer-json,
{
resolve: gatsby-source-filesystem,
options: {
name: src,
path: ${__dirname}/src/,
},
},
{
resolve: gatsby-plugin-typography,
options: {
pathToConfigModule: src/utils/typography.js,
},
},
],
}
@pedrotavaresgoncalves would you be able to create a repository where you can reproduce this? The other issue looks like it has concluded as this was the problem.
Only able to solve with these specs.
Got them in gatsby-starter-blog.
Trying with the latest versions of gatsby (2.0.33 and above), gatsby-sharp-plugin and gatsby-transformer-sharp always broke in compilation stage when loading gatsby-transformer-sharp.
System:
OS: macOS 10.14
CPU: x64 Intel(R) Core(TM) i7-3615QM CPU @ 2.30GHz
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 11.0.0 - /usr/local/bin/node
npm: 6.4.1 - /usr/local/bin/npm
Browsers:
Chrome: 70.0.3538.77
Firefox: 60.0.2
Safari: 12.0
npmPackages:
gatsby: 2.0.19 => 2.0.19
gatsby-image: ^2.0.19 => 2.0.19
gatsby-plugin-manifest: 2.0.2 => 2.0.2
gatsby-plugin-offline: 2.0.5 => 2.0.5
gatsby-plugin-react-helmet: 3.0.0 => 3.0.0
gatsby-plugin-sass: 2.0.1 => 2.0.1
gatsby-plugin-sharp: 2.0.6 => 2.0.6
gatsby-plugin-typography: ^2.2.0 => 2.2.0
gatsby-source-filesystem: 2.0.1 => 2.0.1
gatsby-transformer-json: 2.1.2 => 2.1.2
gatsby-transformer-remark: 2.1.3 => 2.1.3
gatsby-transformer-sharp: 2.1.3 => 2.1.3
npmGlobalPackages:
gatsby-cli: 2.4.4
Had to use npm --build-from-source for installing sharp and firebase in node 11 .
Had the same issue. Can confirm that downgrading from gatsby-transformer-sharp: ^2.1.7 to 2.1.4 and gatsby-plugin-sharp: ^2.0.7 to just 2.0.7 fixed the issue for me.
@btk I don't think this is a duplicate issue, right?
@pedrotavaresgoncalves yeah, I followed your steps, but couldn't work it out. It might be about the environment? Can you reproduce the issue on a repository, and maybe hook it into a CI to see if your problem is about the environment, or a bug in Gatsby is causing this?
@btk
Here's a repo https://github.com/pedrotavaresgoncalves/gatsby-debug
install instructions:
1)npm install --save firebase --build-from-source
2)npm install --save [email protected]
3)npm install --save [email protected] --build-from-source
4)npm install --save [email protected]
5) npm install
I copy pasted from my terminal :)
hope it helps
Solved the development mode problem but still having trouble to build as you can see in #9707
Maybe node 11 is not yet very safe to use with gatsby v2
I pulled your test repository, there was no errors thrown. My node version is v8.10.0, it might be bc of that, would you be able to try changing the version of your node and see if it is about the node version?
Some findings:
Downgrading Node solves npm install issues that forced to use --build-from-source.
Can upgrade Gatsby to latest version and everything works in dev mode.
If upgrade gatsby-plugin-sharp it breaks. Have to stay in 2.0.6
System:
OS: macOS 10.14
CPU: (8) x64 Intel(R) Core(TM) i7-3615QM CPU @ 2.30GHz
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.13.0 - ~/.nvm/versions/node/v10.13.0/bin/node
npm: 6.4.1 - ~/.nvm/versions/node/v10.13.0/bin/npm
Browsers:
Chrome: 70.0.3538.77
Firefox: 60.0.2
Safari: 12.0
npmPackages:
gatsby: ^2.0.40 => 2.0.40
gatsby-cli: ^2.4.4 => 2.4.4
gatsby-image: ^2.0.19 => 2.0.19
gatsby-plugin-lodash: ^3.0.2 => 3.0.2
gatsby-plugin-manifest: 2.0.2 => 2.0.2
gatsby-plugin-offline: 2.0.5 => 2.0.5
gatsby-plugin-react-helmet: ^3.0.1 => 3.0.1
gatsby-plugin-sass: 2.0.1 => 2.0.1
gatsby-plugin-sharp: ^2.0.6 => 2.0.6
gatsby-plugin-typography: ^2.2.0 => 2.2.0
gatsby-source-filesystem: 2.0.1 => 2.0.1
gatsby-transformer-json: 2.1.2 => 2.1.2
gatsby-transformer-remark: 2.1.3 => 2.1.3
gatsby-transformer-sharp: ^2.1.3 => 2.1.3
npmGlobalPackages:
gatsby-cli: 2.4.4
Conclusions:
avoid node 11 for now and seems that sharp has a problem with newer versions of gatsby.
@KyleAMathews
@btk could you give a look at #9707. Maybe you have some ideas :)
There's an upstream issue with one of gatsby-plugin-sharp's dependencies on Node 11.
The workaround for now is to delete your node_modules and run npm install --build-from-source.
For details, see: https://github.com/grpc/grpc-node/issues/594#issuecomment-435563547.
Most helpful comment
Had the same issue. Can confirm that downgrading from
gatsby-transformer-sharp: ^2.1.7to2.1.4andgatsby-plugin-sharp: ^2.0.7to just2.0.7fixed the issue for me.