Do you want to request a feature or report a bug?
Possibly a bug.
What is the current behavior?
yarn install
fails with the following stack trace. Been trying to debug this for over an hour with no success.
yarn install v1.16.0
info No lockfile found.
[1/4] ๐ Resolving packages...
warning gatsby > [email protected]: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
warning gatsby > joi > [email protected]: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
warning gatsby > @reach/router > create-react-context > fbjs > [email protected]: core-js@<2.6.5 is no longer maintained. Please, upgrade to core-js@3 or at least to actual version of core-js@2.
warning gatsby > joi > [email protected]: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
warning gatsby > joi > topo > [email protected]: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
warning gatsby-plugin-offline > workbox-build > [email protected]: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
warning gatsby-plugin-offline > workbox-build > joi > [email protected]: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
warning gatsby-plugin-offline > workbox-build > joi > [email protected]: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
[2/4] ๐ Fetching packages...
[3/4] ๐ Linking dependencies...
warning "gatsby-plugin-netlify > [email protected]" has unmet peer dependency "webpack@>=4.4.0".
warning " > [email protected]" has incorrect peer dependency "react-helmet@^5.1.3".
[4/4] ๐จ Building fresh packages...
[-/8] โ waiting...
[-/8] โ waiting...
[-/8] โ waiting...
[4/8] โ sharp
error /Users/Janosh/Projects/ocean-artup/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/Janosh/Projects/ocean-artup/node_modules/sharp
Output:
info sharp Using cached /Users/Janosh/.npm/_libvips/libvips-8.7.0-darwin-x64.tar.gz
prebuild-install WARN install No prebuilt binaries found (target=12.1.0 runtime=node arch=x64 libc= platform=darwin)
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | x64
gyp info spawn /usr/bin/python
gyp info spawn args [
gyp info spawn args '/usr/local/Cellar/node/12.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/Janosh/Projects/ocean-artup/node_modules/sharp/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/usr/local/Cellar/node/12.1.0/libexec/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/Janosh/.node-gyp/12.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/Janosh/.node-gyp/12.1.0',
gyp info spawn args '-Dnode_gyp_dir=/usr/local/Cellar/node/12.1.0/libexec/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/Users/Janosh/.node-gyp/12.1.0/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/Users/Janosh/Projects/ocean-artup/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
In file included from ../src/common.cc:27:
../src/common.h:78:20: error: no member named 'Handle' in namespace 'v8'
bool HasAttr(v8::Handle<v8::Object> obj, std::string attr);
~~~~^
../src/common.h:78:37: error: expected '(' for function-style cast or type construction
bool HasAttr(v8::Handle<v8::Object> obj, std::string attr);
~~~~~~~~~~^
../src/common.h:78:39: error: use of undeclared identifier 'obj'
bool HasAttr(v8::Handle<v8::Object> obj, std::string attr);
^
../src/common.h:78:56: error: expected '(' for function-style cast or type construction
bool HasAttr(v8::Handle<v8::Object> obj, std::string attr);
~~~~~~~~~~~ ^
../src/common.h:79:29: error: no member named 'Handle' in namespace 'v8'
std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr);
~~~~^
../src/common.h:79:46: error: expected '(' for function-style cast or type construction
std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr);
~~~~~~~~~~^
../src/common.h:79:48: error: use of undeclared identifier 'obj'
std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr);
^
../src/common.h:79:65: error: expected '(' for function-style cast or type construction
std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr);
~~~~~~~~~~~ ^
../src/common.h:80:38: error: no member named 'Handle' in namespace 'v8'
std::vector<double> AttrAsRgba(v8::Handle<v8::Object> obj, std::string attr);
~~~~^
../src/common.h:80:55: error: expected '(' for function-style cast or type construction
std::vector<double> AttrAsRgba(v8::Handle<v8::Object> obj, std::string attr);
~~~~~~~~~~^
../src/common.h:80:57: error: use of undeclared identifier 'obj'
std::vector<double> AttrAsRgba(v8::Handle<v8::Object> obj, std::string attr);
^
../src/common.h:80:74: error: expected '(' for function-style cast or type construction
std::vector<double> AttrAsRgba(v8::Handle<v8::Object> obj, std::string attr);
~~~~~~~~~~~ ^
../src/common.h:81:37: warning: variable templates are a C++14 extension [-Wc++14-extensions]
template<typename T> v8::Local<T> AttrAs(v8::Handle<v8::Object> obj, std::string attr) {
^
../src/common.h:81:48: error: no member named 'Handle' in namespace 'v8'
template<typename T> v8::Local<T> AttrAs(v8::Handle<v8::Object> obj, std::string attr) {
~~~~^
../src/common.h:81:65: error: expected '(' for function-style cast or type construction
template<typename T> v8::Local<T> AttrAs(v8::Handle<v8::Object> obj, std::string attr) {
~~~~~~~~~~^
../src/common.h:81:67: error: use of undeclared identifier 'obj'
template<typename T> v8::Local<T> AttrAs(v8::Handle<v8::Object> obj, std::string attr) {
^
../src/common.h:81:84: error: expected '(' for function-style cast or type construction
template<typename T> v8::Local<T> AttrAs(v8::Handle<v8::Object> obj, std::string attr) {
~~~~~~~~~~~ ^
../src/common.h:81:89: error: expected ';' at end of declaration
template<typename T> v8::Local<T> AttrAs(v8::Handle<v8::Object> obj, std::string attr) {
^
;
../src/common.h:81:90: error: expected unqualified-id
template<typename T> v8::Local<T> AttrAs(v8::Handle<v8::Object> obj, std::string attr) {
^
../src/common.h:84:26: warning: variable templates are a C++14 extension [-Wc++14-extensions]
template<typename T> T AttrTo(v8::Handle<v8::Object> obj, std::string attr) {
^
../src/common.h:84:37: error: no member named 'Handle' in namespace 'v8'
template<typename T> T AttrTo(v8::Handle<v8::Object> obj, std::string attr) {
~~~~^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
2 warnings and 20 errors generated.
make: *** [Release/obj.target/sharp/src/common.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/12.1.0/libexec/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:196:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:256:12)
gyp ERR! System Darwin 18.5.0
gyp ERR! command "/usr/local/Cellar/node/12.1.0/bin/node" "/usr/local/Cellar/node/12.1.0/libexec/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/Janosh/Projects/ocean-artup/node_modules/sharp
gyp ERR! node -v v12.1.0
If the current behavior is a bug, please provide the steps to reproduce.
I recently uninstalled nvm
and all node
versions it had installed. yarn
and the remaining node
were both installed with brew
. Now if I go into any project and do yarn
or yarn add foo
, it fails with the above error.
I tried among others yarn clean cache
, yarn global add node-gyp
, yarn global remove node-gyp
, npx node-gyp install
, npm install -g node-gyp
, brew uninstall yarn node
, brew install yarn node
, rm -rf .node-gyp .npm
. Nothing worked.
What is the expected behavior?
Successful dependency installation.
Please mention your node.js, yarn and operating system version.
node
: 12.1.0
yarn
: 1.16.0
OS: macOS 10.14.4
I should mention also that yarn global add node-gyp
removes yarn
from the path. After that calling yarn
gives zsh: command not found: yarn
until I do brew reinstall yarn
. This doesn't seem like expected behavior so maybe related?
I have the same issue. I tried reverting back to [email protected]
which produces the same error.
So my suspicion is that this is more related to node
upgrading to v12.
Edit: reverting to [email protected]
& [email protected]
fixed it for me.
@damusnet I can confirm downgrading to [email protected]
is a workaround. Thanks for the tip. Did you try node@11
?
@janosh I wanted to, but unfortunately Homebrew does not seem to have a node@11
version handy ๐
Probably because only node 8 and node 10 are LTS, and node 12 will be the next LTS (but not yet)
Thanks @janosh for creating this issue.
Thanks @damusnet for the fix.
node
on brew
was just updated to v12.3.0 but the error remains.
Can confirm this issue still present with yarn v1.16 and node v12.3.1, similar/same error message pointing to node-gyp
Downgrading to node v10.16.0 with yarn v1.16 resolves the issue.
This is not a bug with yarn or node-gyp but sharp. You should upgrade the affected dependencies.
@DanielRuf Interesting. Do you have a source with further info? Also, which version of sharp do I need?
Hi @janosh,
The error is thrown from the libvips binary which is part of sharp.
error /Users/Janosh/Projects/ocean-artup/node_modules/sharp: Command failed.
info sharp Using cached /Users/Janosh/.npm/_libvips/libvips-8.7.0-darwin-x64.tar.gz
prebuild-install WARN install No prebuilt binaries found (target=12.1.0 runtime=node arch=x64 libc= platform=darwin)
config file for FYP: https://github.com/lovell/sharp/blob/master/binding.gyp
sharp 0.22.1 adds NodeJS 12 support, see https://github.com/lovell/sharp/blob/master/docs/changelog.md#v0221---25th-april-2019
Thanks for the additional info. Unfortunately, sharp
0.22.1 doesn't solve the issue I'm having. I'm installing the latest versions of gatsby-plugin-sharp
and gatsby-transformer-sharp
which both specify sharp
^0.22.1 as a dependency but attempting yarn install
still fails with the same error.
@janosh can you provide the output that you see?
What does yarn list --pattern sharp
output? Did you remove your yarn.lock
and node_modules
?
Ah now it worked. I had overlooked that gatsby-plugin-manifest
and gatsby-remark-images-contentful
also depend on sharp
. Specifying the latest versions of those in package.json
and removing yarn.lock
finally made yarn install
suceed! Thanks a lot for the hint. Closing this issue now.
I am aslo the same problem @janosh
Hi @xiejinhe,
Please check the provided solutions and open a new issue.
I can confirm downgrading to node v10.16.0 worked for me as well.
I can confirm downgrading to node v10.16.0 worked for me as well.
removed node_modules and .lock file too
As per @janosh sugestion, just deleting yarn.lock and running yarn install
resolved the issue for me.
I've had problems with this because of an incompatible node-sass version. In my case I just updated it in package.json to the latest:
"node-sass": "~4.13.0",
Then run yarn upgrade, or delete yarn.lock and run yarn install
I can confirm deleting yarn.lock and running yarn install
solves the issue.
I'm in a situation where I cannot delete the yarn.lock file because of CI build issues. Downgrading Node to 10.16.0 worked for me.
I seem to have this issue when I try to deploy with CI pipeline and even with inside a docker container. Unfortunately I might not be able to downgrade the node version to 10.
The issue seems to be appear on
node -v 12.18. Any one still looking at this thread ?
Most helpful comment
Ah now it worked. I had overlooked that
gatsby-plugin-manifest
andgatsby-remark-images-contentful
also depend onsharp
. Specifying the latest versions of those inpackage.json
and removingyarn.lock
finally madeyarn install
suceed! Thanks a lot for the hint. Closing this issue now.