I cannot get this thing to work. I was following these instructions from digitalocean:
How To Install Node.js on Ubuntu 22.04
Then, I am getting this error messages:
sudo apt install nodejs
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
nodejs
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/28.3 MB of archives.
After this operation, 179 MB of additional disk space will be used.
(Reading database ... 332991 files and directories currently installed.)
Preparing to unpack .../nodejs_18.7.0-deb-1nodesource1_amd64.deb ...
Unpacking nodejs (18.7.0-deb-1nodesource1) ...
dpkg: error processing archive /var/cache/apt/archives/nodejs_18.7.0-deb-1nodesource1_amd64.deb (--unpack):
trying to overwrite '/usr/share/systemtap/tapset/node.stp', which is also in package libnode72:amd64 12.22.9~dfsg-1ubuntu3
Errors were encountered while processing:
/var/cache/apt/archives/nodejs_18.7.0-deb-1nodesource1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
I found this article:
Upgrading nodejs on Ubuntu: How to fix broken pipe error?
But its an older version of Ubuntu. I need some help to perform this project.
sudo apt remove nodejs npm
does not uninstall the older versions of nodejs? Should I runsudo apt purge nodejs*
andsudo apt purge npm*
– krillavilla Aug 06 '22 at 02:52sudo dpkg -i --force-overwrite <file-path>
break my system? in my casesudo dpkg -i --force-overwrite /usr/share/systemtap/tapset/node.stp
– krillavilla Aug 06 '22 at 02:56krillavilla@OMEN:~$ sudo dpkg -i --force-overwrite /usr/share/systemtap/tapset/node.stp dpkg-deb: error: '/usr/share/systemtap/tapset/node.stp' is not a Debian format archive dpkg: error processing archive /usr/share/systemtap/tapset/node.stp (--install): dpkg-deb --control subprocess returned error exit status 2 Errors were encountered while processing: /usr/share/systemtap/tapset/node.stp
– krillavilla Aug 06 '22 at 03:00libnode72
which was older version amd64:12.22. I had to remove it first before installing Nodjs newer version – krillavilla Aug 06 '22 at 03:20