Google Colab doesn't let me upgrade nodejs above v12.22.9

103 views Asked by At

I am trying to install node 14 on Google Colab. but it keeps installing node v12.22.9. My project needs node 14 because I want to run puppeteer on it. I have already tried running this as someone else has suggested:

!dpkg --configure -a
!sudo apt-get update
!sudo apt-get install -y ca-certificates curl gnupg
!sudo mkdir -p /etc/apt/keyrings
!curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
!NODE_MAJOR=18 && echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
!sudo apt-get update
# RUN the following commented lines to remove the previous installed nodejs (avoid conflict error)
#!sudo dpkg --remove --force-remove-reinstreq nodejs
#!sudo dpkg --remove --force-remove-reinstreq libnode-dev
#!sudo dpkg --remove --force-remove-reinstreq libnode72:amd64
!sudo apt-get install nodejs -y

But my error message is mostly:

nodejs is already the newest version (12.22.9~dfsg-1ubuntu3.2).
0 upgraded, 0 newly installed, 0 to remove and 17 not upgraded.

I can't post the full error message bc it gets marked as spam. And when I check the version of nodejs it still remains v12. Can anybody help me with this?

Thank you

0

There are 0 answers