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

Error: Failed to install dependency (Sharp) #61

Closed
bronze opened this issue Nov 20, 2019 · 5 comments · Fixed by #69
Closed

Error: Failed to install dependency (Sharp) #61

bronze opened this issue Nov 20, 2019 · 5 comments · Fixed by #69

Comments

@bronze
Copy link

bronze commented Nov 20, 2019

Started having trouble with my version, started to start from scratch with gridsome create my-website https://github.com/drehimself/gridsome-portfolio-starter.git

Gridsome throws this error:

Error: Failed to install dependencies with yarn. Please enter g`ridsome-portfolio-starter2 directory and install dependencies with yarn or npm manually. Then run gridsome develop to start local development.

    Exit code 1
    at ChildProcess.<anonymous> (/Users/bronze/.config/yarn/global/node_modules/@gridsome/cli/lib/commands/create.js:103:17)
    at ChildProcess.emit (events.js:210:5)
    at maybeClose (internal/child_process.js:1028:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)

Then, doing a yarn install i get:

error /Users/bronze/Sites/gridsome-portfolio-starter2/node_modules/sharp: Command failed.
Exit code: 1
Command: (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
Arguments:
Directory: /Users/bronze/Sites/gridsome-portfolio-starter2/node_modules/sharp
Output:
info sharp Using cached /Users/bronze/.npm/_libvips/libvips-8.7.4-darwin-x64.tar.gz
prebuild-install WARN install No prebuilt binaries found (target=13.1.0 runtime=node arch=x64 libc= platform=darwin)
gyp info it worked if it ends with ok
gyp info using node-gyp@5.0.5
gyp info using node@13.1.0 | darwin | x64
gyp info find Python using Python version 2.7.16 found at "/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python"
gyp info spawn /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
gyp info spawn args [
gyp info spawn args   '/usr/local/Cellar/node/13.1.0/libexec/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/bronze/Sites/gridsome-portfolio-starter2/node_modules/sharp/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/local/Cellar/node/13.1.0/libexec/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/bronze/Library/Caches/node-gyp/13.1.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/bronze/Library/Caches/node-gyp/13.1.0',
gyp info spawn args   '-Dnode_gyp_dir=/usr/local/Cellar/node/13.1.0/libexec/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/bronze/Library/Caches/node-gyp/13.1.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/bronze/Sites/gridsome-portfolio-starter2/node_modules/sharp',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  TOUCH Release/obj.target/libvips-cpp.stamp
  CXX(target) Release/obj.target/sharp/src/common.o
  CXX(target) Release/obj.target/sharp/src/metadata.o
  CXX(target) Release/obj.target/sharp/src/stats.o
../src/stats.cc:130:19: error: no matching member function for call to 'Set'
        channels->Set(i, channelStat);
        ~~~~~~~~~~^~~
/Users/bronze/Library/Caches/node-gyp/13.1.0/include/node/v8.h:3424:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                    ^
/Users/bronze/Library/Caches/node-gyp/13.1.0/include/node/v8.h:3427:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
                                    ^
1 error generated.
make: *** [Release/obj.target/sharp/src/stats.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/Cellar/node/13.1.0/libexec/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:210:5)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Darwin 19.0.0
gyp ERR! command "/usr/local/Cellar/node/13.1.0/bin/node" "/usr/local/Cellar/node/13.1.0/libexec/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/bronze/Sites/gridsome-portfolio-starter2/node_modules/sharp

Tried the simple gridsome create with no problems, and even another starter.
Tried removing dependencies from package.json and re-running yarn but that didn't do the trick. (Also, i am unsure if it would... the mechanics of package management are a bit fuzzy to me, honestly)

Anyone else have/had this occur before?

➜ gridsome --version
@gridsome/cli v0.3.1
gridsome v0.7.9

➜ yarn --version
1.19.1

➜ node --version
v13.1.0

@flashspys
Copy link

Go into the package.json and push gridsome to at least version 0.7.0. Then reinstall with yarn

@bronze
Copy link
Author

bronze commented Dec 7, 2019

i have "gridsome": "^0.7.9", as a dependency.
tried getting id of it all and leaving just gridsome and still threw me the error. dont know where it comes from...

@reqresnext
Copy link

Yeah, I have the same error on my office computer. When I installed gridsome on my home computer with pretty fresh nodejs installation - it worked without errors. Still don't know how to fix it

@owlnai
Copy link
Contributor

owlnai commented Dec 22, 2019

FYI, I created a PR to fix this. In the meantime, you can go ahead and change the package.json file from "gridsome": "^0.7.9", to "gridsome": "^0.7.12",. It was fixed on Gridsome's end some time ago, so updating the version should do it.

@bronze
Copy link
Author

bronze commented Dec 22, 2019

@unai01's solution above solved for me! (macOS Catalina 0.15.1 node v13.5.0)

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

Successfully merging a pull request may close this issue.

5 participants