Closed lxbeyond closed 6 years ago
This error occurred because the COLCON_PREFIX_PATH
environment variable is not set while install the rclnodejs
dependency. Please check if had loaded the ROS2 environment? Please check it by: $ echo $AMENT_PREFIX_PATH
.
I use the ros2 bouncy, after I source the local_setup.bash, AMENT_PREFIX_PATH was set, but I still get the error : $ npm install
ref@1.3.5 install /home/xinliu/octopus3/ros2-web-bridge/node_modules/ref node-gyp rebuild
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
make: Entering directory '/home/xinliu/octopus3/ros2-web-bridge/node_modules/ref/build'
CXX(target) Release/obj.target/binding/src/binding.o
../src/binding.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE {anonymous}::WriteInt64(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/binding.cc:360:30: warning: ‘v8::String::Utf8Value::Utf8Value(v8::Local
rclnodejs@0.4.2 install /home/xinliu/octopus3/ros2-web-bridge/node_modules/rclnodejs node-gyp rebuild
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
make: Entering directory '/home/xinliu/octopus3/ros2-web-bridge/node_modules/rclnodejs/build'
CXX(target) Release/obj.target/rclnodejs/src/addon.o
CXX(target) Release/obj.target/rclnodejs/src/executor.o
CXX(target) Release/obj.target/rclnodejs/src/handle_manager.o
CXX(target) Release/obj.target/rclnodejs/src/rcl_bindings.o
../src/rcl_bindings.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE rclnodejs::CreateNode(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/rcl_bindings.cpp:49:55: warning: ‘v8::String::Utf8Value::Utf8Value(v8::Local
^
../src/macros.hpp:20:16: note: in definition of macro ‘CHECK_OP_AND_THROW_ERROR_IF_NOT_TRUE’ if (lhs op rhs) { \ ^ ../src/rcl_bindings.cpp:80:3: note: in expansion of macro ‘THROW_ERROR_IF_NOT_EQUAL’ THROW_ERROR_IF_NOT_EQUAL(RCL_RET_OK, ^ /home/xinliu/ros2_bouncy/zoro-linux/include/rcl/time.h:32:22: note: in expansion of macro ‘RCUTILS_MS_TO_NS’
^
../src/rcl_bindings.cpp:81:57: note: in expansion of macro ‘RCL_MS_TO_NS’
rcl_timer_init(timer, clock, RCL_MS_TO_NS(period_ms),
^
../src/rcl_bindings.cpp:82:79: error: could not convert ‘nullptr’ from ‘std::nullptr_t’ to ‘rcl_allocator_t {aka rcutils_allocator_t}’
nullptr, rcl_get_default_allocator()),
^
../src/macros.hpp:20:16: note: in definition of macro ‘CHECK_OP_AND_THROW_ERROR_IF_NOT_TRUE’
if (lhs op rhs) { \
^
../src/rcl_bindings.cpp:80:3: note: in expansion of macro ‘THROW_ERROR_IF_NOT_EQUAL’
THROW_ERROR_IF_NOT_EQUAL(RCL_RET_OK,
^
rclnodejs.target.mk:124: recipe for target 'Release/obj.target/rclnodejs/src/rcl_bindings.o' failed
make: *** [Release/obj.target/rclnodejs/src/rcl_bindings.o] Error 1
make: Leaving directory '/home/xinliu/octopus3/ros2-web-bridge/node_modules/rclnodejs/build'
gyp ERR! build error
gyp ERR! stack Error: make
failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/home/xinliu/.nvm/versions/node/v10.9.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:239:12)
gyp ERR! System Linux 4.15.0-32-generic
gyp ERR! command "/home/xinliu/.nvm/versions/node/v10.9.0/bin/node" "/home/xinliu/.nvm/versions/node/v10.9.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/xinliu/octopus3/ros2-web-bridge/node_modules/rclnodejs
gyp ERR! node -v v10.9.0
gyp ERR! node-gyp -v v3.7.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! rclnodejs@0.4.2 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the rclnodejs@0.4.2 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:
This is a frequent error recently. This root cause is RCL native APIs changed after ROS2 bouncy release and rclnodejs
always keeps aligned with the latest RCL native APIs. This is a little annoying. You can:
rclnodejs
that works with ROS2 bouncy, we don't recommend as there are bugs not fixed in old version.rclnodejs
CI building for Linux platform:
wget https://ci.ros2.org/view/packaging/job/packaging_xenial_linux/lastSuccessfulBuild/artifact/ws/ros2-package-linux-x86_64.tar.bz2
@lxbeyond If you have to build against bouncy release, I recommend that you install the rclnodejs
from Github which locates at https://github.com/RobotWebTools/rclnodejs/tree/bouncy-bolson, it should work well. Thanks!
I build rclnodejs well from github bouncy-bolson branch, but error when build ros2-web-bridge , and I do not konw how to make ros2-web-bridge to use rclnodejs of bouncy-bolson version . @minggangw
You could change your package.json
"rclnodejs": "^0.4.0",
please reference the document of npm to change it to Github url, hope it works.
I changed package.json "rclnodejs": "git://github.com/RobotWebTools/rclnodejs.git#bouncy-bolson", and it works, thanks @minggangw @qiuzhong
So I think this issue can be closed now, feel free to reopen if you meet any problem in the future. Thanks!
I git clone this rep, and I run "npm install", then get the error: npm install
make: Entering directory '/home/hzh/xinliu/ros2-web-bridge/node_modules/ref/build' CXX(target) Release/obj.target/binding/src/binding.o ../src/binding.cc: In function ‘void init(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)’: ../src/binding.cc:643:8: warning: ‘Nan::Maybe Nan::ForceSet(v8::Local, v8::Local, v8::Local, v8::PropertyAttribute)’ is deprecated [-Wdeprecated-declarations]
Nan::ForceSet(target, Nan::New("endianness").ToLocalChecked(), Nan::New(CheckEndianness()).
^
In file included from ../../nan/nan.h:197:0,
from ../src/binding.cc:7:
../../nan/nan_maybe_43_inl.h:130:35: note: declared here
NAN_DEPRECATED inline Maybe ForceSet(
^
../src/binding.cc:643:8: warning: ‘Nan::Maybe Nan::ForceSet(v8::Local, v8::Local, v8::Local, v8::PropertyAttribute)’ is deprecated [-Wdeprecated-declarations]
Nan::ForceSet(target, Nan::New("endianness").ToLocalChecked(), Nan::New(CheckEndianness()).
^
In file included from ../../nan/nan.h:197:0,
from ../src/binding.cc:7:
../../nan/nan_maybe_43_inl.h:130:35: note: declared here
NAN_DEPRECATED inline Maybe ForceSet(
^
../src/binding.cc:643:187: warning: ‘Nan::Maybe Nan::ForceSet(v8::Local, v8::Local, v8::Local, v8::PropertyAttribute)’ is deprecated [-Wdeprecated-declarations]
ed(), Nan::New(CheckEndianness()).ToLocalChecked(), static_cast(ReadOnly|DontDelete));
^
In file included from ../../nan/nan.h:197:0,
from ../src/binding.cc:7:
../../nan/nan_maybe_43_inl.h:130:35: note: declared here
NAN_DEPRECATED inline Maybe ForceSet(
^
../src/binding.cc:644:8: warning: ‘Nan::Maybe Nan::ForceSet(v8::Local, v8::Local, v8::Local, v8::PropertyAttribute)’ is deprecated [-Wdeprecated-declarations]
Nan::ForceSet(target, Nan::New("NULL").ToLocalChecked(), WrapNullPointer(), static_cast<PropertyAttribu
^
In file included from ../../nan/nan.h:197:0,
from ../src/binding.cc:7:
../../nan/nan_maybe_43_inl.h:130:35: note: declared here
NAN_DEPRECATED inline Maybe ForceSet(
^
../src/binding.cc:644:8: warning: ‘Nan::Maybe Nan::ForceSet(v8::Local, v8::Local, v8::Local, v8::PropertyAttribute)’ is deprecated [-Wdeprecated-declarations]
Nan::ForceSet(target, Nan::New("NULL").ToLocalChecked(), WrapNullPointer(), static_cast<PropertyAttribu
^
In file included from ../../nan/nan.h:197:0,
from ../src/binding.cc:7:
../../nan/nan_maybe_43_inl.h:130:35: note: declared here
NAN_DEPRECATED inline Maybe ForceSet(
^
../src/binding.cc:644:142: warning: ‘Nan::Maybe Nan::ForceSet(v8::Local, v8::Local, v8::Local, v8::PropertyAttribute)’ is deprecated [-Wdeprecated-declarations]
n::New("NULL").ToLocalChecked(), WrapNullPointer(), static_cast(ReadOnly|DontDelete));
^
In file included from ../../nan/nan.h:197:0,
from ../src/binding.cc:7:
../../nan/nan_maybe_43_inl.h:130:35: note: declared here
NAN_DEPRECATED inline Maybe ForceSet(
^
SOLINK_MODULE(target) Release/obj.target/binding.node
COPY Release/binding.node
make: Leaving directory '/home/hzh/xinliu/ros2-web-bridge/node_modules/ref/build'
Downloading Chromium r579032 - 102.3 Mb [====================] 100% 0.0s Chromium downloaded to /home/hzh/xinliu/ros2-web-bridge/node_modules/puppeteer/.local-chromium/linux-579032
console.log(process.env.COLCON_PREFIX_PATH.replace(/:/, '/include/ ') + '/include/') ^
TypeError: Cannot read property 'replace' of undefined at eval:1:44 at ContextifyScript.Script.runInThisContext (vm.js:50:33) at Object.runInThisContext (vm.js:139:38) at Object. (eval-wrapper:6:22)
at Module._compile (module.js:652:30)
at evalScript (bootstrap_node.js:466:27)
at startup (bootstrap_node.js:167:9)
at bootstrap_node.js:612:3
gyp: Call to 'node -e "console.log(process.env.COLCON_PREFIX_PATH.replace(/:/, '/include/ ') + '/include/')"' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error:
gyp
failed with exit code: 1 gyp ERR! stack at ChildProcess.onCpExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:336:16) gyp ERR! stack at emitTwo (events.js:126:13) gyp ERR! stack at ChildProcess.emit (events.js:214:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12) gyp ERR! System Linux 4.15.0-30-generic gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /home/hzh/xinliu/ros2-web-bridge/node_modules/rclnodejs gyp ERR! node -v v8.11.2 gyp ERR! node-gyp -v v3.6.2 gyp ERR! not ok npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! rclnodejs@0.4.2 install:node-gyp rebuild
npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the rclnodejs@0.4.2 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! /home/hzh/.npm/_logs/2018-08-21T11_36_13_719Z-debug.log
and the node version is v8.11.2 , nvm version is : 0.33.11