How to delete node_modules and reinstall

How to delete node_modules and reinstall

When we are developing a project, there will be a problem that the version of the node package installed each time is inconsistent with the version required by the project. Therefore, you need to delete the node package and reinstall it. Many friends just delete it manually, but do not delete the package cache, so an error will still be reported when starting the project~

The next article will simply and directly tell you the detailed operation steps.

For Windows

Step 1: Install node_modules in the directory where the project needs to be installed

insert image description here

Step 2: Install the rimraf tool first

npm install -g rimraf

Step 3: Delete the node_modules package and package-lock.json file

rimraf node_modules
rimraf package-lock.json

Note: Both node_modules and package-lock.json need to be deleted. Deleting only node_modules will not work.

Step 4: Clear the cache

npm cache clear --force

Step 5: Reinstall dependency packages

The package-lock.json file will be automatically generated after the installation is complete

npm config set registry [https://registry.npm.taobao.org]

npm install

Step 6: Restart the project

This is the end of this article about how to delete node_modules and reinstall them. For more information about deleting node_modules and reinstalling them, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Detailed explanation of how to modify files in node_modules
  • Detailed explanation of modification and use of third-party modules in node_modules in Vue
  • The difference between modules.exports and exports in node

<<:  Summary of MySQL 8.0 memory-related parameters

>>:  Ubuntu 20.04 turns on hidden recording noise reduction function (recommended)

Recommend

CSS3 realizes bouncing ball animation

I usually like to visit the special pages or prod...

Discussion on the problem of iframe node initialization

Today I suddenly thought of reviewing the producti...

How to use shtml include

By applying it, some public areas of the website c...

Completely delete MySQL steps

Table of contents 1. Stop MySQL Server first 2. U...

Several common methods for passing additional parameters when submitting a form

When submitting a form, you may encounter situatio...

MySQL 8.0.12 Quick Installation Tutorial

The installation of MySQL 8.0.12 took two days an...

Summary of horizontal scrolling website design

Horizontal scrolling isn’t appropriate in all situ...

How to use IDEA to configure tomcat and create JSP files

Before using idea to write JSP files, you need to...

An elegant way to handle WeChat applet authorization login

Preface When the WeChat mini program project invo...

TortoiseSvn Little Turtle Installation Latest Detailed Graphics Tutorial

There were always problems when installing tortoi...

Basic usage of @Font-face and how to make it compatible with all browsers

@Font-face basic introduction: @font-face is a CSS...

Share 9 Linux Shell Scripting Tips for Practice and Interviews

Precautions 1) Add interpreter at the beginning: ...

Simple implementation method of vue3 source code analysis

Table of contents Preface 🍹Preparation 🍲vue3 usag...

Detailed tutorial on installing MySQL offline on CentOS7

1. Delete the original mariadb, otherwise mysql c...