【node.js】How to ensure node.js is uninstalled cleanly

To ensure that Node.js has been completely uninstalled, you can perform the following steps:

1. Check the Node.js version:

Run the following command in the terminal to check the version of Node.js. If Node.js has been uninstalled, a "command not found" or similar error should be displayed.

node -v

If Node.js has been uninstalled, you should get a "'node' is not an internal or external command" or similar error.

2. Check npm version:

Similarly, run the following command in the terminal or command prompt to check whether npm version information is output:

npm -v

3. Check the global npm package:

Use the following command to list globally installed npm packages. This will display the global npm packages you installed before uninstalling Node.js. If Node.js has been uninstalled, this command will not be able to find npm and nothing will be displayed.

npm list -g --depth=0

4. Check the installation directory:

In the file system, make sure the Node.js installation directory has been deleted. Typically, Node.js is in a directory such as /usr/local (for Linux/Mac) or C:\Program Files\nodejs (for Windows).

5. Check the PATH environment variable:

Make sure that Node.js related paths have been removed from your system PATH environment variable. Open the shell configuration file (such as .bashrc, .zshrc or system environment variable settings) to check whether there is any PATH configuration for Node.js.

6. Check other configuration files:

On some systems, Node.js may have other configuration files, such as .npmrc or .nvmrc, make sure these files are also deleted or modified to appropriate values.

In summary, make sure you check your system PATH, Node.js installation directory, global npm packages, and related configuration files. If these steps were followed correctly, Node.js should be completely uninstalled.

おすすめ

転載: blog.csdn.net/weixin_45188218/article/details/135342715