Update: I was mistaken. Not only is nodejs
packaged for most recent Ubuntu releases, it's also been a rosdep package since at least 2014: https://github.com/ros/rosdistro/comm...
So, what you have to do is a lot smaller; i.e.,
# my_catkin_project/package.xml
...
<depend>nodejs</depend>
...
# my_catkin_project/CMakeLists.txt
...
catkin_package(my_catkin_project DEPENDS nodejs)
...
Original answer follows.
Buckle up --- this is a multi-step process.
First, tell apt
where to find the node stuff. Follow their instructions, or, if you're feeling fancy...
Get their pubkey:
root@mybionic:~# apt-key adv --keyserver keyserver.ubuntu.com --recv-key 9FD3B784BC1C6FC31A8A0A1C1655A0AB68576280
Point your apt
to their repository:
# /etc/apt/sources.list.d/nodejs.list
deb https://deb.nodesource.com/node_10.x bionic main
deb-src https://deb.nodesource.com/node_10.x bionic main
And update your apt
cache:keycode 64 = Alt_L NoSymbol Alt_L
keycode 92 = Alt_R NoSymbol Alt_R
keycode 108 = Alt_R NoSymbol Alt_R
root@mybionic:~# apt update
Next, you have to convince rosdep
(read "lie") that there is a ROS package called nodejs
which, for each and every ROS-supported Operating System, is called nodejs
. This fakery requires two files, one "rosdep yaml" file to provide the aforementioned associations...
# /var/lib/rosdep/nodejs.yaml
nodejs:
arch: [nodejs]
cygwin: [nodejs]
debian: [nodejs]
fedora: [nodejs]
freebsd: [nodejs]
gentoo: [nodejs]
opensuse: [nodejs]
osx: [nodejs]
rhel: [nodejs]
ubuntu: [nodejs]
...and one "rosdep list" file to tell rosdistro about the yaml file:
# /etc/ros/rosdep/sources.list.d/nodejs.list
yaml file:///var/lib/rosdep/nodejs.yaml
Note that the rosdep yaml can live anywhere you want, but, given that this is stateful file whose contents affect the entire ROS installation, it makes sense to put it somewhere only root
can touch it. Note also that, since bloom v0.8.0, it's not enough to configure for a proper subset of supported platforms --- you have to configure for all of them.
After emplacing the rosdep yaml and rosdep list, you can rosdep update
. Now, when rosdep
sees...
# my_catkin_project/package.xml
...
<depend>nodejs</depend>
...
...it will delegate to apt
the installation of the package (if it's not already installed).
I can't tell from your question the nature of the conflict you describe. Is it that
apt
sees someConflicts:
and/orReplaces:
between aros-melodic-*
package and thenodejs
package?Exactly. I believe the first thing to do for @xavier12358 would be to clarify what the precise problem is.