webviz icon indicating copy to clipboard operation
webviz copied to clipboard

Fail to bootstrap using node v12

Open IanBoyanZhang opened this issue 4 years ago • 9 comments

Hello Webviz team,

Thanks for releasing such an awesome tool! When I try setting project up with node v12.0.0 installed from nvm, I got below v8 error(s).

Switched to v11.15.0, npm run bootstrap successfully completed bootstrap process.

Looks like the error is related to

Issue 849 nan support for node 12

/Users/user/.node-gyp/12.0.0/include/node/v8.h:3416:3: note: 'Get' has been explicitly marked
      deprecated here
  V8_DEPRECATE_SOON("Use maybe version", Local<Value> Get(uint32_t index));
  ^
/Users/user/.node-gyp/12.0.0/include/node/v8config.h:322:29: note: expanded from macro
      'V8_DEPRECATE_SOON'
  declarator __attribute__((deprecated(message)))
                            ^
In file included from ../src/binding.cpp:1:
In file included from ../../nan/nan.h:2698:
_../../nan/nan_object_wrap.h:24:25: error: no member named 'IsNearDeath' in
      'Nan::Persistent<v8::Object, v8::NonCopyablePersistentTraits<v8::Object> >'
    assert(persistent().IsNearDeath());_
           ~~~~~~~~~~~~ ^
/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/binding.cpp:1:
In file included from ../../nan/nan.h:2698:
../../nan/nan_object_wrap.h:67:18: warning: 'MarkIndependent' is deprecated: Weak objects are always
      considered independent. Use TracedGlobal when trying to use EmbedderHeapTracer. Use a strong
      handle when trying to keep an object alive. [-Wdeprecated-declarations]
    persistent().MarkIndependent();
                 ^
/Users/user/.node-gyp/12.0.0/include/node/v8.h:563:3: note: 'MarkIndependent' has been
      explicitly marked deprecated here
  V8_DEPRECATED(
  ^
/Users/user/.node-gyp/12.0.0/include/node/v8config.h:307:29: note: expanded from macro
      'V8_DEPRECATED'
  declarator __attribute__((deprecated(message)))
                            ^
In file included from ../src/binding.cpp:1:
In file included from ../../nan/nan.h:2698:
../../nan/nan_object_wrap.h:124:26: error: no member named 'IsNearDeath' in
      'Nan::Persistent<v8::Object, v8::NonCopyablePersistentTraits<v8::Object> >'
    assert(wrap->handle_.IsNearDeath());
           ~~~~~~~~~~~~~ ^
/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/binding.cpp:1:
../../nan/nan.h:2378:9: warning: 'Set' is deprecated: Use maybe version [-Wdeprecated-declarations]
  recv->Set(name, GetFunction(tpl).ToLocalChecked());
        ^
../../nan/nan.h:2394:8: note: in instantiation of function template specialization
      'Nan::imp::SetMethodAux<v8::Local<v8::Object> >' requested here
  imp::SetMethodAux(recv, fn_name, t, static_cast<T*>(0));
       ^
../src/binding.cpp:351:8: note: in instantiation of function template specialization
      'Nan::SetMethod<v8::Object, Local>' requested here
  Nan::SetMethod(target, "render", render);
       ^
/Users/user/.node-gyp/12.0.0/include/node/v8.h:3358:3: note: 'Set' has been explicitly marked
      deprecated here
  V8_DEPRECATE_SOON("Use maybe version",
  ^
/Users/user/.node-gyp/12.0.0/include/node/v8config.h:322:29: note: expanded from macro
      'V8_DEPRECATE_SOON'
  declarator __attribute__((deprecated(message)))
                            ^
11 warnings and 3 errors generated.
make: *** [Release/obj.target/binding/src/binding.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/user/workspace/webviz/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.7.0
gyp ERR! command "/Users/user/.nvm/versions/node/v12.0.0/bin/node" "/Users/user/workspace/webviz/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /Users/user/workspace/webviz/node_modules/node-sass
gyp ERR! node -v v12.0.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: `node install`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall 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/user/.npm/_logs/2020-02-08T21_37_47_020Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! root@ bootstrap: `npm install && lerna bootstrap --hoist "{react,react-dom}"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the root@ bootstrap 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:

IanBoyanZhang avatar Feb 08 '20 22:02 IanBoyanZhang

Yeah we should update our dependencies, so we get the fix from node-sass.

janpaul123 avatar Feb 10 '20 17:02 janpaul123

I had the same issue. Solved by uninstalling node v13 and the install node v11 instead. Think it might work with node v10 as well.

Sollimann avatar Mar 12 '20 13:03 Sollimann

@IanBoyanZhang did you get this to work? Btw @IanBoyanZhang and @Sollimann, I'm trying to get to know our open source community better, and would love to learn more about what you use Webviz for. Could you perhaps shoot me an email at [email protected]?

janpaul123 avatar Mar 26 '20 00:03 janpaul123

@janpaul123 yea, got it to work. however, seems to be an issue in regards to rosbridge when subscribing to nav_msgs/Odometry /tf and joint_states. I get this error message: Exception calling subscribe callback: 'float' object has no attribute 'slots' . I added a issue on it 28 days ago. As to your second question: I'm working in a Norwegian software company called Cognite that provides software solutions for the Oil & Gas industry. In recent time we have started a heavy investment in industrial robotics solutions. We wanted a web-based visualization tool for some of our robots running ROS middleware, and came across webviz.

Sollimann avatar Mar 26 '20 09:03 Sollimann

Cool, that makes a lot of sense, thanks for sharing! As for the other issue, that should be fixed now (see the other thread). I'll leave this ticket here open in case other people try to use node v12 (we'll have to make it compatible at some point!).

janpaul123 avatar Apr 09 '20 18:04 janpaul123

Did confirm does work with Node v10.20.0 as well

cjds avatar Apr 11 '20 18:04 cjds

I'm kind of new to this, so sorry if this is not helpful! I got the same error and tried

sudo npm install

and got similar errors,

I then deleted package-lock.json and the node_modules and then bootstrap ran without errors (as well as the build process). I'm having difficulties with getting the npm run docs-deploy to work however, but I'll post that in another topic.

jaguardo avatar Dec 09 '20 17:12 jaguardo

@jaguardo what's your node version? We support >=10.22.0 <12.

vidaaudrey avatar Dec 10 '20 17:12 vidaaudrey

copy that... I just installed the latest, so v15? I'll have to try downgrading, just not sure what else that will break. I just thought it was interesting that I could get around the errors by deleting/re-install... obviously not a good long term solution, however it works... up until I got to npm run docs-deply but I think I might appreciate why that isn't working (stand alone machine with separate git repository)... thanks!

jaguardo avatar Dec 10 '20 18:12 jaguardo