llaske / sugarizer-server

Sugarizer Server allow deployment of Sugarizer on a local server, for example on a school server.
Apache License 2.0
42 stars 92 forks source link

Sugarizer Server don't work on nodejs 10.x #18

Closed llaske closed 5 years ago

llaske commented 5 years ago

npm install fail with error:

npm WARN deprecated connect@2.30.2: connect 2.x series is deprecated

> fibers@1.0.15 install /Users/lionel/src/olpc/sugarizer-server/node_modules/fibers
> node build.js || nodejs build.js

  CXX(target) Release/obj.target/fibers/src/fibers.o
../src/fibers.cc:122:64: error: too few arguments to function call, expected at least 3, have 2
                return String::NewFromOneByte(isolate, (const uint8_t*)string);
                       ~~~~~~~~~~~~~~~~~~~~~~                                ^
/Users/lionel/.node-gyp/10.15.0/include/node/v8.h:2802:3: note: 'NewFromOneByte' declared here
  static V8_WARN_UNUSED_RESULT MaybeLocal<String> NewFromOneByte(
  ^
../src/fibers.cc:126:64: error: too few arguments to function call, expected at least 3, have 2
                return String::NewFromOneByte(isolate, (const uint8_t*)string);
                       ~~~~~~~~~~~~~~~~~~~~~~                                ^
/Users/lionel/.node-gyp/10.15.0/include/node/v8.h:2802:3: note: 'NewFromOneByte' declared here
  static V8_WARN_UNUSED_RESULT MaybeLocal<String> NewFromOneByte(
  ^
../src/fibers.cc:406:24: warning: 'Utf8Value' is deprecated [-Wdeprecated-declarations]
                                        String::Utf8Value stack(uni::Deref(that.isolate, fatal_stack));
                                                          ^
/Users/lionel/.node-gyp/10.15.0/include/node/v8.h:2891:5: note: 'Utf8Value' has been explicitly marked deprecated here
    V8_DEPRECATED("Use Isolate version",
    ^
/Users/lionel/.node-gyp/10.15.0/include/node/v8config.h:327:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated))
                            ^
../src/fibers.cc:433:80: error: no matching member function for call to 'NewInstance'
                                return uni::Return(uni::Deref(Isolate::GetCurrent(), tmpl)->GetFunction()->NewInstance(1, argv), args);
                                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
/Users/lionel/.node-gyp/10.15.0/include/node/v8.h:3996:44: note: candidate function not viable: requires single argument 'context', but 2
      arguments were provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(
                                           ^
/Users/lionel/.node-gyp/10.15.0/include/node/v8.h:3993:44: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(
                                           ^
../src/fibers.cc:621:14: error: no matching constructor for initialization of 'v8::TryCatch'
                                TryCatch try_catch;
                                         ^
/Users/lionel/.node-gyp/10.15.0/include/node/v8.h:8536:12: note: candidate constructor not viable: requires single argument 'isolate', but no
      arguments were provided
  explicit TryCatch(Isolate* isolate);
           ^
/Users/lionel/.node-gyp/10.15.0/include/node/v8.h:8656:3: note: candidate constructor not viable: requires 1 argument, but 0 were provided
  TryCatch(const TryCatch&) = delete;
  ^
../src/fibers.cc:628:13: warning: 'Compile' is deprecated [-Wdeprecated-declarations]
                                Script::Compile(uni::NewLatin1String(that.isolate, "void 0;"));
                                        ^
/Users/lionel/.node-gyp/10.15.0/include/node/v8.h:1255:10: note: 'Compile' has been explicitly marked deprecated here
  static V8_DEPRECATED("Use maybe version",
         ^
/Users/lionel/.node-gyp/10.15.0/include/node/v8config.h:327:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated))
                            ^
../src/fibers.cc:741:34: error: no matching member function for call to 'ToNumber'
                        Coroutine::pool_size = value->ToNumber()->Value();
                                               ~~~~~~~^~~~~~~~
/Users/lionel/.node-gyp/10.15.0/include/node/v8.h:2425:44: note: candidate function not viable: requires single argument 'context', but no
      arguments were provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Number> ToNumber(
                                           ^
/Users/lionel/.node-gyp/10.15.0/include/node/v8.h:2442:31: note: candidate function not viable: requires single argument 'isolate', but no
      arguments were provided
                Local<Number> ToNumber(Isolate* isolate) const);
                              ^
../src/fibers.cc:793:72: error: too few arguments to function call, expected at least 3, have 2
                        fn->SetAccessor(uni::NewLatin1Symbol(isolate, "current"), GetCurrent);
                        ~~~~~~~~~~~~~~~                                                     ^
/Users/lionel/.node-gyp/10.15.0/include/node/v8.h:3348:3: note: 'SetAccessor' declared here
  V8_WARN_UNUSED_RESULT Maybe<bool> SetAccessor(
  ^
/Users/lionel/.node-gyp/10.15.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/fibers.cc:794:63: error: no viable conversion from 'uni::FunctionType (Local<v8::String>, const uni::GetterCallbackInfo &)' (aka 'void
      (Local<v8::String>, const PropertyCallbackInfo<v8::Value> &)') to 'Local<v8::Name>'
                        fn->SetAccessor(uni::NewLatin1Symbol(isolate, "poolSize"), GetPoolSize, SetPoolSize);
                                                                                   ^~~~~~~~~~~
/Users/lionel/.node-gyp/10.15.0/include/node/v8.h:204:7: note: candidate constructor (the implicit copy constructor) not viable: no known
      conversion from 'uni::FunctionType (Local<v8::String>, const uni::GetterCallbackInfo &)' (aka 'void (Local<v8::String>, const
      PropertyCallbackInfo<v8::Value> &)') to 'const v8::Local<v8::Name> &' for 1st argument
class Local {
      ^
/Users/lionel/.node-gyp/10.15.0/include/node/v8.h:204:7: note: candidate constructor (the implicit move constructor) not viable: no known
      conversion from 'uni::FunctionType (Local<v8::String>, const uni::GetterCallbackInfo &)' (aka 'void (Local<v8::String>, const
      PropertyCallbackInfo<v8::Value> &)') to 'v8::Local<v8::Name> &&' for 1st argument
/Users/lionel/.node-gyp/10.15.0/include/node/v8.h:208:13: note: candidate template ignored: could not match 'Local<type-parameter-0-0>' against
      'void (*)(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value> &)'
  V8_INLINE Local(Local<S> that)
            ^
/Users/lionel/.node-gyp/10.15.0/include/node/v8.h:3349:43: note: passing argument to parameter 'name' here
      Local<Context> context, Local<Name> name,
                                          ^
../src/fibers.cc:795:84: error: too few arguments to function call, expected at least 3, have 2
                        fn->SetAccessor(uni::NewLatin1Symbol(isolate, "fibersCreated"), GetFibersCreated);
                        ~~~~~~~~~~~~~~~                                                                 ^
/Users/lionel/.node-gyp/10.15.0/include/node/v8.h:3348:3: note: 'SetAccessor' declared here
  V8_WARN_UNUSED_RESULT Maybe<bool> SetAccessor(
  ^
/Users/lionel/.node-gyp/10.15.0/include/node/v8config.h:416:31: note: expanded from macro 'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
                              ^
In file included from ../src/fibers.cc:1:
In file included from ../src/coroutine.h:1:
In file included from /Users/lionel/.node-gyp/10.15.0/include/node/node.h:63:
/Users/lionel/.node-gyp/10.15.0/include/node/v8.h:215:5: error: assigning to 'v8::Context *' from incompatible type 'v8::String *'
    TYPE_CHECK(T, S);
    ^~~~~~~~~~~~~~~~
/Users/lionel/.node-gyp/10.15.0/include/node/v8.h:169:39: note: expanded from macro 'TYPE_CHECK'
    *(static_cast<T* volatile*>(0)) = static_cast<S*>(0);      \
                                      ^~~~~~~~~~~~~~~~~~
../src/fibers.cc:794:20: note: in instantiation of function template specialization 'v8::Local<v8::Context>::Local<v8::String>' requested here
                        fn->SetAccessor(uni::NewLatin1Symbol(isolate, "poolSize"), GetPoolSize, SetPoolSize);
                                        ^
2 warnings and 9 errors generated.
make: *** [Release/obj.target/fibers/src/fibers.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@10/10.15.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)
gyp ERR! System Darwin 18.2.0
gyp ERR! command "/usr/local/Cellar/node@10/10.15.0/bin/node" "/usr/local/Cellar/node@10/10.15.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release"
gyp ERR! cwd /Users/lionel/src/olpc/sugarizer-server/node_modules/fibers
gyp ERR! node -v v10.15.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
node-gyp exited with code: 1
Please make sure you are using a supported platform and node version. If you
would like to compile fibers on this machine please make sure you have setup your
build environment--
Windows + OS X instructions here: https://github.com/nodejs/node-gyp
Ubuntu users please run: `sudo apt-get install g++ build-essential`
Alpine users please run: `sudo apk add python make g++`
sh: nodejs: command not found
npm WARN The package nodemon is included as both a dev and production dependency.

npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! fibers@1.0.15 install: `node build.js || nodejs build.js`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the fibers@1.0.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/lionel/.npm/_logs/2019-01-17T10_34_09_662Z-debug.log
llaske commented 5 years ago

Fixed in https://github.com/llaske/sugarizer-server/commit/50c1a575d25d649422e7bf8954d33f4103f46d07

utkarsh-raj commented 5 years ago

For the backwards compatibility till the v1.1 running the following command for the Ubuntu users might help, since this sets up the essential build environment for the installation of the deprecated version.

sudo apt-get install g++ build-essential

The issue can probably be safely closed @llaske .

llaske commented 5 years ago

Thanks @utkarsh-raj, I will close the issue when the version 1.1 will be release.

sweezy793 commented 5 years ago

@llaske Which version of node does Sugarizer work with? I have node 10.X installed and I'm facing the exact problem