zooniverse / scribeAPI

scribe API
MIT License
79 stars 25 forks source link

npm install fails on Mac #600

Closed johnscancella closed 6 years ago

johnscancella commented 6 years ago

I was following the guide from https://github.com/zooniverse/scribeAPI/wiki/Setup-Mac-OSX and when I try to npm install it errors:

npm WARN deprecated graceful-fs@2.0.3: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js

> contextify@0.1.15 install /Users/jscancella/development/repos/scribeAPI/node_modules/contextify
> node-gyp rebuild

  CXX(target) Release/obj.target/contextify/src/contextify.o
../src/contextify.cc:131:56: error: no matching member function for call to
      'NewInstance'
        Local<Object> wrapper = Nan::New(constructor)->NewInstance();
                                ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
/Users/jscancella/.node-gyp/10.4.0/include/node/v8.h:3908:44: note: candidate
      function not viable: requires single argument 'context', but no arguments
      were provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(
                                           ^
/Users/jscancella/.node-gyp/10.4.0/include/node/v8.h:3905:44: note: candidate
      function not viable: requires 3 arguments, but 0 were provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(
                                           ^
../src/contextify.cc:150:16: error: no member named 'SetAccessCheckCallbacks' in
      'v8::ObjectTemplate'
        otmpl->SetAccessCheckCallbacks(GlobalPropertyNamedAccessCheck,
        ~~~~~  ^
../src/contextify.cc:182:80: error: too few arguments to function call, expected
      2, have 1
  ...rv = Nan::New(ctx->sandbox)->GetRealNamedProperty(property);
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~         ^
/Users/jscancella/.node-gyp/10.4.0/include/node/v8.h:3474:3: note:
      'GetRealNamedProperty' declared here
  V8_WARN_UNUSED_RESULT MaybeLocal<Value> GetRealNamedProperty(
  ^
/Users/jscancella/.node-gyp/10.4.0/include/node/v8config.h:416:31: note:
      expanded from macro 'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
                              ^
../src/contextify.cc:209:67: error: too few arguments to function call, expected
      2, have 1
        if (!Nan::New(ctx->sandbox)->GetRealNamedProperty(property).IsEmpty() ||
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~         ^
/Users/jscancella/.node-gyp/10.4.0/include/node/v8.h:3474:3: note:
      'GetRealNamedProperty' declared here
  V8_WARN_UNUSED_RESULT MaybeLocal<Value> GetRealNamedProperty(
  ^
/Users/jscancella/.node-gyp/10.4.0/include/node/v8config.h:416:31: note:
      expanded from macro 'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
                              ^
../src/contextify.cc:210:71: error: too few arguments to function call, expected
      2, have 1
            !Nan::New(ctx->proxyGlobal)->GetRealNamedProperty(property)....
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~         ^
/Users/jscancella/.node-gyp/10.4.0/include/node/v8.h:3474:3: note:
      'GetRealNamedProperty' declared here
  V8_WARN_UNUSED_RESULT MaybeLocal<Value> GetRealNamedProperty(
  ^
/Users/jscancella/.node-gyp/10.4.0/include/node/v8config.h:416:31: note:
      expanded from macro 'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
                              ^
5 errors generated.
make: *** [Release/obj.target/contextify/src/contextify.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/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12)
gyp ERR! System Darwin 17.5.0
gyp ERR! command "/usr/local/Cellar/node/10.4.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/jscancella/development/repos/scribeAPI/node_modules/contextify
gyp ERR! node -v v10.4.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN scribeAPI@ No repository field.
npm WARN The package json-api-client is included as both a dev and production dependency.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! contextify@0.1.15 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the contextify@0.1.15 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/jscancella/.npm/_logs/2018-06-12T16_51_28_223Z-debug.log

Any help is greatly appreciated! 2018-06-12T16_51_28_223Z-debug.log

camallen commented 6 years ago

Hi - check you are running a node version that this code can work with, see https://github.com/zooniverse/scribeAPI/issues/597#issuecomment-377234756 for more details.

eatyourgreens commented 6 years ago

npm install completes (with warnings) for me on OSX with node 0.10.48/npm 2.15.1. Fails with a node-gyp build error with node 8.11.1/npm 5.6.0

Even though installation succeeds with 0.10, I see a bunch of version warnings from dependencies that require more recent versions of node.

EDIT: node 6 is the most recent version that I can get to work with Scribe. @johnscancella if you don't use it already, I recommend installing nvm so that you can easily switch node versions.

johnscancella commented 6 years ago

@camallen thanks for that, I didn't realize I needed such an old version of node.

johnscancella commented 6 years ago

When I reverted to node 4.9.1 and npm 2.15.11 which then works.

srallen commented 6 years ago

This line could be updated to better reflect the node versions that work: https://github.com/zooniverse/scribeAPI/blob/master/package.json#L10