Перейти к содержимому

Как удалить node js

  • автор:

How to uninstall Node.js? Remove Node.js from your system completely

How to uninstall Node.js? Remove Node.js from your system completely

There is no restriction on the type of programming language used for writing server-side code. Some of the popular examples include PHP, Ruby, C#, Python, and Javascript. Out of all these, Javascript is very much popular because of its beginner-friendliness and being able to be used both on the client-side and server-side as well.

As the server-side runtime environment for Javascript, Node.js lets you build scalable web applications with ease. Despite its popularity among beginning developers, Node.js does not fit every developer’s needs, especially those with different language backgrounds or preferences.

This tutorial will walk you through a step-by-step guide to completely remove Node.js from your computer. Let’s take a deep breath and dive right in!

Prerequisites

Before uninstalling Node.js, it is important that we check if Node.js is properly installed in our system or not. The way we can check that varies by the operating system.

Check if Node.js installed on Windows

  • Using File Explorer:
  • Go to File Explorer, open This PC ->C:/ drive.
  • Look for the Nodejs folder in the directory where you installed Nodejs originally.
  • Some of the other files where we can check for Nodejs or npm files:
    • C:Program Files (x86)Nodejs
    • C:Program FilesNodejs
    • C:Users»user»AppDataRoamingnpm
    • C:Users»user»AppDataRoamingnpm-cache

    Using CMD:

    • Search for “ cmd ” in the start menu. Right-click on it and select “Run as administrator”.
    • Or, Press Win+R to open “run”. Enter “ cmd ” and hit Ctrl+Shift+Enter to open the command prompt as administrator.
    • Write the following command:
    node --version
    Code language: JavaScript (javascript)

    If you get a result like this, it indicates Node is correctly installed on your system:

    v16.16.0
    Code language: JavaScript (javascript)

    Check if Node.js installed on Linux

    You can check if Node.js is installed by typing node -v in Terminal. The version number will appear in the terminal. It should look something like this:

    v16.16.0
    Code language: JavaScript (javascript)

    Check if Node.js installed on Mac

    1. Press command+space to open Spotlight Search.
    2. Type “ Terminal ” and press enter.
    3. Check if Node.js is installed by typing node -v in Terminal.
    4. You should see the version of Node.js that was installed, something like this:
    v16.16.0
    Code language: JavaScript (javascript)

    Uninstalling the Node.js in Windows

    There are actually three ways through which we can remove Node.js from our windows system. Let’s have a look at each of them.

    Method 1: Uninstalling from Windows Settings

    • Go to Settings by searching it in the start menu.
    • Click on the Apps section.
    • Look for the search box under Apps & Features section, and enter Nodejs there.
    • Select on Nodejs application and click on uninstall.
    • It is recommended that you restart your Windows machine even if you aren’t prompted to do so.
    • Lastly, run cmd as administrator and type:
    node --version
    Code language: JavaScript (javascript)

    • If you see an output like this: then Node is successfully uninstalled from your computer.

    Method 2: Uninstalling from Windows CMD

    • Search for “ cmd ” in the start menu. Right-click on it and select “Run as administrator“.
    • Or, Press Win+R to open “run“. Enter “ cmd ” and hit Ctrl+Shift+Enter to open the command prompt as administrator.
    • Run the following command in your terminal to clear your npm cache:
    npm cache clean --force
    Code language: JavaScript (javascript)
    • Now, to remove Node.js and npm successfully:
      • Go to the windows control panel.
      • Select Uninstall a program.
      • Right-Click on Nodejs and uninstall.
      • Lastly, run cmd as administrator and type:
      node --version
      Code language: JavaScript (javascript)

      • If you see an output like this: then Node is successfully uninstalled from your computer.

      Method 3: Uninstalling from Windows Registry

      • Search for “ Registry Editor ” in the start menu and click on it.
      • Or, Press Win+R to open “run“. Enter “ regedit ” and hit Enter to open the Windows Registry.
      • A prompt will open asking you to allow the app to make changes. Click Yes.
      • You can either go to the path below or paste it in the path field: ComputerHKEY_LOCAL_MACHINESOFTWARENode.js
      • As a next step, locate the Nodejs directory on the left sidebar. Right-click on it and delete the directory.
      • It is recommended that you restart your Windows machine even if you aren’t prompted to do so.
      • Lastly, run cmd as administrator and type:
      node --version
      Code language: JavaScript (javascript)

      • If you see an output like this: then Node is successfully uninstalled from your compute

      Uninstalling the Node.js in Ubuntu

      We will examine multiple options to uninstall NodeJS in Ubuntu using the three typical commands: uninstall, remove and purge.

      Step 1: Locating the Binary Files

      You can locate the folder where NodeJS binaries are located and verify if it’s uninstalled as well. This can be done using the which or find command as shown below:

      $ which node $ find $(echo $PATH | sed 's/:/ /g') -name "node"
      Code language: JavaScript (javascript)
      $ find / -name "node"
      Code language: JavaScript (javascript)

      You should see an output similar to this if the node is installed:

      /user/bin/node /user/bin/node
      Code language: JavaScript (javascript)
      /user/bin/node /user/share/doc/node /user/share/code/resources/app/extensions/emmet/dist/node /user/share/code/resources/app/extensions/css-language-features/server/dist/node /user/share/code/resources/app/extensions/css-language-features/client/dist/node /user/share/code/resources/app/extensions/ms-vscode.js-debug/src/targets/node /user/share/code/resources/app/extensions/html-language-features/server/dist/node /user/share/code/resources/app/extensions/html-language-features/client/dist/node /user/share/code/resources/app/extensions/json-language-features/server/dist/node /user/share/code/resources/app/extensions/json-language-features/client/dist/node /user/share/code/resources/app/out/vs/workbench/api/node /user/share/code/resources/app/out/vs/workbench/contrib/debug/node /user/share/code/resources/app/out/vs/workbench/contrib/externalTerminal/node /user/share/code/resources/app/out/vs/base/node /user/share/code/resources/app/out/vs/platform/files/node /user/share/code/resources/app/out/vs/platform/environment/node /user/share/code/resources/app/out/vs/platform/terminal/node j/user/share/code/resources/app/out/vs/code/node /user/include/node
      Code language: JavaScript (javascript)

      Step 2: Uninstalling NodeJS

      Now, there are different ways of removing Nodejs from the system. Let’s look at some of the options below:

      Method 1: Removing the binary paths

      We can discard Nodejs by manually deleting the binaries we located in the previous step, although this method is less recommended than others.

      $ sudo rm /user/bin/node
      Code language: JavaScript (javascript)
      Method 2: Use the apt or apt-get command to Uninstall

      The most commonly used commands in Ubuntu to uninstall NodeJS are apt and apt-get.

      $ sudo apt-get remove nodejs
      Code language: JavaScript (javascript)

      The above command only removes the package. In order to remove all the node-related packages as well, see the methods in step 4.

      Method 3: Uninstalling a Particular version of NodeJS

      Suppose you want to uninstall only a specific version of NodeJS. You can use the below command to remove that version only. Eg:

      $ nvm uninstall 16.16.0
      Code language: JavaScript (javascript)

      You should see an output like this:

      Uninstalled node v16.16.0
      Code language: JavaScript (javascript)

      Step 3: Removing NodeJS info from the Source Lists

      After removing NodeJS, check to see if there is any NodeJS data present in the /etc/apt/sources.list.d directory:

      $ ls /etc/apt/sources.list.d
      Code language: JavaScript (javascript)

      You should see folders named nodesource.list and nodesource.list.distUpgrade. If not present then your NodeJS information is removed from the sources list. Otherwise, Use the below command to remove them:

      $ rm -rf nodesource.list nodesource.list.distUpgrade
      Code language: JavaScript (javascript)

      Last but not the least, make sure to update the Ubuntu repositories.

      $ sudo apt-get update
      Code language: JavaScript (javascript)

      Step 4: Clearing the Cache

      NodeJS can sometimes leave traces of some packages and modules after uninstalling. You can use any of the following methods to remove all the node-related packages as well as the configuration files.

      Method 1: Using the purge command

      The purge command helps us remove all these packages and files. Use any of the two commands below:

      $ sudo apt-get purge nodejs
      Code language: JavaScript (javascript)
      $ sudo apt-get purge – auto-remove nodejs
      Code language: JavaScript (javascript)
      Method 2: Removing npm manually

      You can manually remove the hidden npm directories and other related files using the below commands:

      $ ls -la $ rm -rf .npm
      Code language: JavaScript (javascript)

      Step 5: Remove Unused Files

      The last step is to run the following command to get rid of unused files and free up the space on your computer.

      $ sudo apt-get autoremove
      Code language: JavaScript (javascript)

      Uninstalling the Node.js on Mac

      Now, let’s look at some of the ways to uninstall Node.js from MacOS as well.

      Method 1: Uninstalling using homebrew

      • Click on the search icon in the menu bar or press command + space to launch the spotlight.
      • Type terminal and hit Return .
      • Run this command to uninstall all versions of Node from your mac.
      # brew uninstall --force node
      Code language: JavaScript (javascript)
      • Once that’s done, type the following command to remove unused folders and dependencies.
      # brew cleanup
      Code language: JavaScript (javascript)

      Method 2: Uninstalling using NVM

      • Click on the search icon in the menu bar or press command + space to launch the spotlight.
      • Type terminal and hit Return .
      • To uninstall the node with the help of nvm, type the following command, replacing with the current version of your node installed. Eg: v16.16.0.
      # nvm uninstall
      Code language: JavaScript (javascript)

      Method 3: Uninstalling using terminal

      • Click on the search icon in the menu bar or press command + space to launch the spotlight.
      • Type terminal and hit Return .
      • Once the terminal is opened, enter the given below command:
      # sudo rm -rf /usr/local/,bin,share/man>/
      Code language: JavaScript (javascript)
      • The above command will not remove all of the packages. To delete every global package you have installed using npm, run the below command:
      # rm –rf ~/.npm
      Code language: JavaScript (javascript)

      Method 4: Uninstalling Node Manually

      • From the Dock, select the Go menu and then Folder from the Finder icon.
      • In the text box, paste the directory path: /usr/local/lib
      • Then move any files that have the name ‘node’ to the Trash.
      • Paste each of the following paths into the text box in Go to Folder and drag the files with the name ‘node’ to the Trash.
      /usr/local/bin /usr/local/include /usr/local/share/man/man1/ /usr/local/lib/dtrace/ /opt/local/bin/ /opt/local/include/ /opt/local/include/ /usr/local/share/doc/ /usr/local/share/systemtap/tapset/
      Code language: JavaScript (javascript)
      • Drag the following files in the Home folder to the Trash: .npm, .node-gyp, .nodereplhistory .
      • Lastly, empty the Trash.

      Conclusion

      That was pretty much it! Hopefully, you can now successfully uninstall NodeJS from your computer.

      If you ever feel lost and want help understanding where to start your coding journey then go check out Codedamn. There are amazing courses and blogs for web development and other coding concepts. Remember to practice coding on a daily basis. You can play around with your code on Codedamn’s online compiler as well

      Let us know in the comments if you have any suggestions or queries. Finally, If you are interested in my content and would like to connect, then you can find me on Linkedin or Twitter.

      Become The Best Full-Stack Developer ��

      Codedamn is the best place to become a proficient developer. Get access to hunderes of practice Node.js courses, labs, and become employable full-stack web developer.

      Unlimited access to all platform courses

      100+ practice projects included

      ChatGPT Based Instant AI Help

      Structured Node.js Full-Stack Roadmap To Get A Job

      Exclusive community for events, workshops

      Sharing is caring

      Did you like what Indrakant wrote? Thank them for their work by sharing it on social media.

      Here’s how to uninstall Node on your Mac

      Having spent some years coding applications for macOS, we’ve created a tool that everybody can use. The all-round problem fixer for Mac.

      CleanMyMac X

      So here’s a tip for you: Download CleanMyMac to quickly solve some of the issues mentioned in this article. But to help you do it all by yourself, we’ve gathered our best ideas and solutions below.

      Features described in this article refer to the MacPaw site version of CleanMyMac X.

      If you’ve installed Node.js on your Mac to learn how it works and experiment using it on a server you run but no longer want it, you should uninstall it. Uninstalling software you don’t use is good practice, as it frees up space and reduces the possibility of its files causing conflicts with other software on your Mac. In this article, I’ll show you how to uninstall Node.js.

      What is Node.js?

      First, let’s take a closer look at what Node.js is and what it does, just in case you found it lurking on your Mac and do not recall installing it in the first place.

      Node.js is a server-side JavaScript runtime environment that executes JavaScript instructions on a server and delivers the results to the web browser client. It runs on macOS, Windows, Linux, and other platforms. Some well-known organizations, such as Netflix, Microsoft, LinkedIn, and Amazon AWS, use it to deliver their online services. It’s built on Google’s Chrome V8 JavaScript engine but is open source and can be downloaded by anyone.

      How to uninstall Node.js on your Mac

      There are several ways to uninstall Node from your Mac. The best one for you to use depends on how you installed it in the first place. Choose the options that best fit your situation below.

      How to uninstall Node.js manually

      This one is the most challenging way to uninstall Node, as you will have to track down lots of different files and remove them manually one by one.

      • Click on the Finder icon in the Dock, choose the Go menu, and then Go to Folder.
      • Paste the following directory path in the text box: /usr/local/lib
      • Look for files with the name ‘node’ and move them to the Trash.
      • Repeat these three steps for the following directories, pasting each path into the text box in Go to Folder and dragging the files with ‘node’ to the Trash.
      • Go to your Home folder and drag the files below to the Trash: .npm; .node-gyp; .nodereplhistory.
      • Empty the Trash.

      How to uninstall Node.js if you installed it using Homebrew

      If you installed Node using Homebrew, go to Applications > Utilities and open Terminal, then type the following command:

      brew uninstall —force node

      That will uninstall Node and all of its components.

      How to uninstall Node.js if you installed it with Node Version Manager (NVM)

      If you used NVM to install Node, open Terminal and type the following command:

      Replace with the version number of Node.js you installed. So, for example, if you installed v17.0, you would type:

      nvm uninstall v17.0

      How to uninstall any app easily

      As you can see, there are a lot of steps involved in completely uninstalling Node.js. The same is true for most applications. If you want to uninstall them manually and thoroughly, you will need to hunt down every file and drag it to the Trash.

      However, there is a more effortless way, thanks to a handy application called CleanMyMac X. Among many other valuable tools, CleanMyMac X has an Uninstaller module that takes all the work out of uninstalling apps. You can download it for free here.

      Once you’ve downloaded it, follow the steps below to uninstall an application.

      Unused Apps in Uninstaller module in CleanMyMac X

      1. Open CleanMyMac X and choose Uninstaller.
      2. Locate the application you want to uninstall (tip: you can filter applications by clicking the name of the developer in the middle pane or find them through the search bar).
      3. Check the button next to the application’s name.
      4. Click Uninstall.

      How to remove application leftovers

      Remember we mentioned earlier that if you have moved an application binary to the Trash, you still need to remove leftovers? Well, you can do that using CleanMyMac X, too.

      Leftovers in the Uninstaller module of CMMX

      1. Choose the Uninstaller module.
      2. In the middle pane, select Leftovers (the number next to it tells you how many leftover files CleanMyMac X has found).
      3. Check the button next to the leftovers you want to remove in the right pane.
      4. Click Uninstall.

      Once the removal is complete, you can rest assured that all app traces are gone from your Mac for good. The app frees up precious space and eliminates the possibility of those files causing a problem in the future.

      Node.js is a server-side JavaScript runtime environment that you may have installed on your Mac. If you no longer need it or use it, you should uninstall it to free up space and prevent it from conflicting with other software on your Mac. Follow the steps above to uninstall Node.js and use CleanMyMac X to remove any leftover files from Node or any other application.

      How To Uninstall Node.js From MacOs 2023

      If you are a new MacOs user like me and use your mac to develop software, you will find that some of the applications you install in the mac cannot be removed by clicking uninstall like in windows.

      Node.js is constantly evolving and pumping out new versions. At some point in your development career, you will have to change or upgrade your Node.js version.

      This article will cover a few common ways to uninstall Node.js from your mac.

      The default installation of Node.js:

      This method assumes you have installed Node.js using the official installer from the Node.js website.

      • Press Cmd + Space to open Spotlight search, type in «Terminal,» and hit Enter to open the Terminal app. Or any other terminal you use.
      • Remove Node.js installation directory: Run the following command in Terminal to remove the Node.js installation directory:
      sudo rm -rf /usr/local/,lib/node_modules/npm,lib/node,share/man/*/node.*>

      This command removes Node.js, NPM, NPX, and related files.

      • Remove global Node.js packages (optional): If you want to remove global Node.js packages installed on your system, run the following command:
      sudo rm -rf /usr/local/lib/node_modules

      Homebrew:

      • Press Cmd + Space to open Spotlight search, type in «Terminal,» and hit Enter to open the Terminal app. Or any other terminal you use.
      • Run the following command in Terminal to uninstall Node.js:
      brew uninstall node

      MacPorts:

      1. Press Cmd + Space to open Spotlight search, type in «Terminal,» and hit Enter to open the Terminal app. Or any other terminal you use.
      2. Run the following command in Terminal to uninstall Node.js:
      sudo port uninstall nodejs

      Check if Node.js has been removed:

      • To verify that Node.js has been uninstalled, you can run the following commands:
      node -v
      npm -v
      npx -v

      If Node.js has been successfully uninstalled, these commands should return “command not found” or a similar error message.

      I hope this article saved you 10 minutes of researching the internet as it will save future me!

      How to Install/Uninstall NodeJS on Ubuntu 18.04

      How to Install/Uninstall NodeJS on Ubuntu 18.04

      While we believe that this content benefits our community, we have not yet thoroughly reviewed it. If you have any suggestions for improvements, please let us know by clicking the “report an issue“ button at the bottom of the tutorial.

      NodeJS is a JavaScript framework that allows you to build fast network applications with ease. In this guide, we delve in and see how you can How to install NodeJS on Ubuntu 18.04.

      Step 1: Adding the NodeJS PPA to Ubuntu 18.04

      To start off, add the NodeJS PPA to your system using the following commands.

      sudo apt-get install software-properties-common 

      Sudo Apt Install Software Properties Common

      Sample Output Next, add the NodeJS PPA.

      curl -sL https://deb.nodesource.com/setup_11.x | sudo -E bash - 

      Add Current NodeJS Release

      Sample Output Great! In our next step, we are going to run the command for installing NodeJS.

      Step 2: Install NodeJS on Ubuntu

      After successfully adding the NodeJS PPA, It’s time now to install NodeJS using the command below.

      sudo apt-get install nodejs 

      Install NodeJs on Ubuntu 18.04

      Sample Output This command not only installs NodeJS but also NPM (NodeJS Package Manager) and other dependencies as well.

      Step 3: Verfiying the version of NodeJS and NPM

      After successful installation of NodeJS, you can test the version of NodeJS using the simple command below.

      node -v 

      testing the version of NodeJS in Ubuntu 18.04

      Sample Output For NPM, run

      npm -v 

      Testing the version of NPM

      Sample Output

      Step 4: Creating a Web Server demonstration

      This is an optional step that you can use to test if NodeJS is working as intended. We are going to create a web server that displays the text “Congratulations! node.JS has successfully been installed !” Let’s create a NodeJS file and call it nodeapp.js

      vim nodeapp.js 

      Add the following content

      var http = require('http'); http.createServer(function (req, res) < res.writeHead(200, ); res.end('Congratulations! node.JS has successfully been installed !\n'); >).listen(3000, " server-ip); console.log('Server running at https://server-ip:3000/'); 

      Save and exit the text editor Start the application using the command below

      node nodeapp.js 

      Running Node Js Application

      Sample Output This will display the content of the application on port 3000. Ensure the port is allowed on the firewall of your system.

      ufw allow 3000/tcp ufw reload 

      Now open your browser and browse the server’s address as shown

      https://server-ip:3000 

      Success Nodejs Has Successfully Been Instaled

      Uninstall NodeJS from Ubuntu

      If you wish to uninstall NodeJS from your Ubuntu system, run the command below.

      sudo apt-get remove nodejs 

      The command will remove the package but retain the configuration files. To remove both the package and the configuration files run:

      sudo apt-get purge nodejs 

      As a final step, you can run the command below to remove any unused files and free up the disk space

      sudo apt-get autoremove 

      Great! We have successfully installed and tested the installation of NodeJS. We also learned how to uninstall NodeJS from Ubuntu and clean up space.

      Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases. Learn more about us

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *