Gatsby: Errors when starting a new Gatsby project

Created on 1 May 2019  Â·  8Comments  Â·  Source: gatsbyjs/gatsby

Im getting the following error when I try to start a new Gatsby project.

I type

gatsby new gatsby-site

and receive:

info sharp Using cached /Users/tom/.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)
TOUCH Release/obj.target/libvips-cpp.stamp
CXX(target) Release/obj.target/sharp/src/common.o
In file included from ../src/common.cc:24:
In file included from ../../nan/nan.h:223:
In file included from ../../nan/nan_new.h:189:
../../nan/nan_implementation_12_inl.h:356:37: error: too few arguments to function call,
expected 2, have 1
return v8::StringObject::New(value).As();
~~~~~ ^
/Users/tom/.node-gyp/12.1.0/include/node/v8.h:5380:3: note: 'New' declared here
static Local New(Isolate* isolate, Local value);
^
In file included from ../src/common.cc:24:
In file included from ../../nan/nan.h:223:
In file included from ../../nan/nan_new.h:189:
../../nan/nan_implementation_12_inl.h:356:58: error: expected '(' for function-style cast
or type construction
return v8::StringObject::New(value).As();
~~~~^
../../nan/nan_implementation_12_inl.h:356:60: error: expected expression
return v8::StringObject::New(value).As();
^
In file included from ../src/common.cc:24:
In file included from ../../nan/nan.h:2722:
../../nan/nan_object_wrap.h:24:25: error: no member named 'IsNearDeath' in
'Nan::Persistent >'
assert(persistent().IsNearDeath());
~~~~ ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/assert.h:93:25: note:
expanded from macro 'assert'
(__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
^
In file included from ../src/common.cc:24:
In file included from ../../nan/nan.h:2722:
../../nan/nan_object_wrap.h:127:26: error: no member named 'IsNearDeath' in
'Nan::Persistent >'
assert(wrap->handle_.IsNearDeath());
~~~ ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/assert.h:93:25: note:
expanded from macro 'assert'
(__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
^
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 obj, std::string attr);
~
~^
../src/common.h:78:37: error: expected '(' for function-style cast or type construction
bool HasAttr(v8::Handle obj, std::string attr);
~~^
../src/common.h:78:39: error: use of undeclared identifier 'obj'
bool HasAttr(v8::Handle obj, std::string attr);
^
../src/common.h:78:56: error: expected '(' for function-style cast or type construction
bool HasAttr(v8::Handle obj, std::string attr);
~~~ ^
../src/common.h:79:29: error: no member named 'Handle' in namespace 'v8'
std::string AttrAsStr(v8::Handle obj, std::string attr);
~~^
../src/common.h:79:46: error: expected '(' for function-style cast or type construction
std::string AttrAsStr(v8::Handle obj, std::string attr);
~
~^
../src/common.h:79:48: error: use of undeclared identifier 'obj'
std::string AttrAsStr(v8::Handle obj, std::string attr);
^
../src/common.h:79:65: error: expected '(' for function-style cast or type construction
std::string AttrAsStr(v8::Handle obj, std::string attr);
~
~~ ^
../src/common.h:80:38: error: no member named 'Handle' in namespace 'v8'
std::vector AttrAsRgba(v8::Handle obj, std::string attr);
~
~^
../src/common.h:80:55: error: expected '(' for function-style cast or type construction
std::vector AttrAsRgba(v8::Handle obj, std::string attr);
~~^
../src/common.h:80:57: error: use of undeclared identifier 'obj'
std::vector AttrAsRgba(v8::Handle obj, std::string attr);
^
../src/common.h:80:74: error: expected '(' for function-style cast or type construction
std::vector AttrAsRgba(v8::Handle obj, std::string attr);
~~~ ^
../src/common.h:81:37: warning: variable templates are a C++14 extension
[-Wc++14-extensions]
template v8::Local AttrAs(v8::Handle obj, std::string attr) {
^
../src/common.h:81:48: error: no member named 'Handle' in namespace 'v8'
template v8::Local AttrAs(v8::Handle obj, std::string attr) {
~~^
../src/common.h:81:65: error: expected '(' for function-style cast or type construction
template v8::Local AttrAs(v8::Handle obj, std::string attr) {
~
~~~^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
1 warning 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 (/Users/tom/.nvm/versions/node/v12.1.0/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 "/Users/tom/.nvm/versions/node/v12.1.0/bin/node" "/Users/tom/.nvm/versions/node/v12.1.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/tom/workspace/develop_with_tom_com/gatsby-site/node_modules/sharp
gyp ERR! node -v v12.1.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
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! /Users/tom/.npm/_logs/2019-05-01T18_29_33_411Z-debug.log
error Command failed: npm install

Error: Command failed: npm install

  • index.js:236
    [lib]/[gatsby-cli]/[execa]/index.js:236:11

  • task_queues.js:89 processTicksAndRejections
    internal/process/task_queues.js:89:5

info sharp Using cached /Users/tom/.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)
TOUCH Release/obj.target/libvips-cpp.stamp
CXX(target) Release/obj.target/sharp/src/common.o
In file included from ../src/common.cc:24:
In file included from ../../nan/nan.h:223:
In file included from ../../nan/nan_new.h:189:
../../nan/nan_implementation_12_inl.h:356:37: error: too few arguments to function call,
expected 2, have 1
return v8::StringObject::New(value).As();
~~~~~ ^
/Users/tom/.node-gyp/12.1.0/include/node/v8.h:5380:3: note: 'New' declared here
static Local New(Isolate* isolate, Local value);
^
In file included from ../src/common.cc:24:
In file included from ../../nan/nan.h:223:
In file included from ../../nan/nan_new.h:189:
../../nan/nan_implementation_12_inl.h:356:58: error: expected '(' for function-style cast
or type construction
return v8::StringObject::New(value).As();
~~~~^
../../nan/nan_implementation_12_inl.h:356:60: error: expected expression
return v8::StringObject::New(value).As();
^
In file included from ../src/common.cc:24:
In file included from ../../nan/nan.h:2722:
../../nan/nan_object_wrap.h:24:25: error: no member named 'IsNearDeath' in
'Nan::Persistent >'
assert(persistent().IsNearDeath());
~~~~ ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/assert.h:93:25: note:
expanded from macro 'assert'
(__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
^
In file included from ../src/common.cc:24:
In file included from ../../nan/nan.h:2722:
../../nan/nan_object_wrap.h:127:26: error: no member named 'IsNearDeath' in
'Nan::Persistent >'
assert(wrap->handle_.IsNearDeath());
~~~ ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/assert.h:93:25: note:
expanded from macro 'assert'
(__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
^
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 obj, std::string attr);
~
~^
../src/common.h:78:37: error: expected '(' for function-style cast or type construction
bool HasAttr(v8::Handle obj, std::string attr);
~~^
../src/common.h:78:39: error: use of undeclared identifier 'obj'
bool HasAttr(v8::Handle obj, std::string attr);
^
../src/common.h:78:56: error: expected '(' for function-style cast or type construction
bool HasAttr(v8::Handle obj, std::string attr);
~~~ ^
../src/common.h:79:29: error: no member named 'Handle' in namespace 'v8'
std::string AttrAsStr(v8::Handle obj, std::string attr);
~~^
../src/common.h:79:46: error: expected '(' for function-style cast or type construction
std::string AttrAsStr(v8::Handle obj, std::string attr);
~
~^
../src/common.h:79:48: error: use of undeclared identifier 'obj'
std::string AttrAsStr(v8::Handle obj, std::string attr);
^
../src/common.h:79:65: error: expected '(' for function-style cast or type construction
std::string AttrAsStr(v8::Handle obj, std::string attr);
~
~~ ^
../src/common.h:80:38: error: no member named 'Handle' in namespace 'v8'
std::vector AttrAsRgba(v8::Handle obj, std::string attr);
~
~^
../src/common.h:80:55: error: expected '(' for function-style cast or type construction
std::vector AttrAsRgba(v8::Handle obj, std::string attr);
~~^
../src/common.h:80:57: error: use of undeclared identifier 'obj'
std::vector AttrAsRgba(v8::Handle obj, std::string attr);
^
../src/common.h:80:74: error: expected '(' for function-style cast or type construction
std::vector AttrAsRgba(v8::Handle obj, std::string attr);
~~~ ^
../src/common.h:81:37: warning: variable templates are a C++14 extension
[-Wc++14-extensions]
template v8::Local AttrAs(v8::Handle obj, std::string attr) {
^
../src/common.h:81:48: error: no member named 'Handle' in namespace 'v8'
template v8::Local AttrAs(v8::Handle obj, std::string attr) {
~~^
../src/common.h:81:65: error: expected '(' for function-style cast or type construction
template v8::Local AttrAs(v8::Handle obj, std::string attr) {
~
~~~^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
1 warning 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 (/Users/tom/.nvm/versions/node/v12.1.0/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 "/Users/tom/.nvm/versions/node/v12.1.0/bin/node" "/Users/tom/.nvm/versions/node/v12.1.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/tom/workspace/develop_with_tom_com/gatsby-site/node_modules/sharp
gyp ERR! node -v v12.1.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
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! /Users/tom/.npm/_logs/2019-05-01T18_29_33_411Z-debug.log
error Command failed: npm install

Error: Command failed: npm install

  • index.js:236
    [lib]/[gatsby-cli]/[execa]/index.js:236:11

  • task_queues.js:89 processTicksAndRejections
    internal/process/task_queues.js:89:5

I'm been stuck on this all day!

If someone could point me in the right direction it would be awesome.

Thank you all :)

needs more info

Most helpful comment

For further context, this is the underlying issue: https://github.com/gatsbyjs/gatsby/issues/13780#issuecomment-488383193

All 8 comments

Thanks for the logs, this certainly appears to be a Sharp issue.

Could you paste the output of gatsby info --clipboard so we could debug further? Thanks!

Thanks for the reply DSchau!

Yes, absolutely:

System:
OS: macOS 10.14.4
CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 12.1.0 - ~/.nvm/versions/node/v12.1.0/bin/node
npm: 6.9.0 - ~/.nvm/versions/node/v12.1.0/bin/npm
Languages:
Python: 3.6.5 - /anaconda3/bin/python
Browsers:
Chrome: 74.0.3729.131
Firefox: 66.0.3
Safari: 12.1
npmGlobalPackages:
gatsby-cli: 2.5.12

It's possible Sharp binaries hasn't as of yet been updated for Node 12.

Could you try Node 11 and see if you run into similar failures?

Im currently getting an error running gatsby develop after upgrading to node 12.

➜ gatsby develop
success open and validate gatsby-configs — 0.009 s
error
      The dependency "sharp" does not seem to have been built or installed correctly.

      - Try to reinstall packages and look for errors during installation
      - Consult "sharp" installation page at http://sharp.pixelplumbing.com/en/stable/install/

      If neither of the above work, please open an issue in https://github.com/gatsbyjs/gatsby/issues

@t2ca you ran yarn again after updating to Node 12, correct? (or npm install)

Yes, I removed the entire node_modules folder and did npm install

now getting this error

➜ gatsby develop
success open and validate gatsby-configs — 0.016 s
error UNHANDLED REJECTION


  Error: Unable to find plugin "gatsby-transformer-sharp". Perhaps you need to inst  all its package?

Thank you DSchau! I used the LTS node of 10.15.3 and everything went smoothly :)

For further context, this is the underlying issue: https://github.com/gatsbyjs/gatsby/issues/13780#issuecomment-488383193

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Oppenheimer1 picture Oppenheimer1  Â·  3Comments

3CordGuy picture 3CordGuy  Â·  3Comments

ghost picture ghost  Â·  3Comments

theduke picture theduke  Â·  3Comments

dustinhorton picture dustinhorton  Â·  3Comments