skip to Main Content

This error occurred while installing nodejs](https://i.stack.imgur.com/JMRiT.jpg)

I am trying to install nodejs but facing this error while installing.

2

Answers


  1. sudo dpkg -i --force-overwrite /var/cache/apt/archives/nodejs_18.12.1-deb-1nodesource1_amd64.deb
    
    sudo apt -f install
    
    sudo apt update
    sudo apt dist-upgrade
    

    Adapted from this: https://askubuntu.com/a/1362727/666464
    I had the same problem today, and now it is solved.

    Login or Signup to reply.
  2. I got the same error,

    Preparing to unpack .../nodejs_18.15.0-deb-1nodesource1_amd64.deb ...
    Unpacking nodejs (18.15.0-deb-1nodesource1) ...
    dpkg: error processing archive /var/cache/apt/archives/nodejs_18.15.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.15.0-deb-1nodesource1_amd64.deb
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    

    but this is the exact error,

    trying to overwrite '/usr/share/systemtap/tapset/node.stp', which is also in package libnode72:amd64 12.22.9~dfsg-1ubuntu3
    

    In my case removed the libnode72 package by running the following command.

    sudo apt remove libnode72
    
    # If above does not work for you, run below commands
    
    sudo dpkg --remove --force-remove-reinstreq libnode-dev
    sudo dpkg --remove --force-remove-reinstreq libnode72:amd64
    

    I think in your case you have to remove the libnode-dev package. Please try it by running the following command,

    sudo apt remove libnode-dev
    

    If this doesn’t work for you or anyone, please add a comment.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search