Solve the problem of nodejs error: Cannot find module 'xxx'. (Summary by myself, pro test is effective)

Insert picture description hereBecause this folder is copied from other places, there is a problem with the path, after deleting the dependencies, restart npm install xxx,(Xxx refers to the module that your computer can't find, such as application) to solve the problem

First delete the dependent packages : Insert picture description here
but! ! : Direct usenpm install xxxwill be very slow, but also easy to install unsuccessful, it is not recommended to use npm.

Solution :
Use Taobao mirror cnpm i xxx (xxx refers to the module that your computer can't find, such as application) The speed is several times faster and the success rate is high.

How to use :

1 . Open cmd, enter the following command

npm install -g cnpm --registry=https://registry.npm.taobao.org

2 . After the show finished, enter the following command (xxx refers to the module that your computer can not find such application)

cnpm i xxx
Published 28 original articles · praised 7 · visited 1175

Guess you like

Origin blog.csdn.net/haduwi/article/details/105346939
Recommended