Vue-cli installs jQuery and reports an error npm ERR! code ETIMEDOUT, npm install freezes during installation, and the command line is now idealTree:isp-bms: sill solution

1. Open vscode, create a new terminal, cd into the specified directory, enter npm install jquery, and install jQuery

npm install jquery

2. It is found that the interface has been stuck, and the installation is not successful, and the terminal displays [...] \ idealTree:message1: sill

Reason: The timeout of downloading dependent packages during npm install is suspected to be caused by the slow download speed of overseas warehouses

Solution: Change the download mirror address through cmd, switch Taobao mirror

1. Input cmd in the lower left corner (enter the content you want to search here), and open the cmd window

2. Enter the command: npm config get registry to view the current mirror address

npm config get registry

3. The default address ( https://registry.npmjs.org/    is abroad, so the installation is slow or stuck

 4. Change the mirror address to Taobao mirror, enter the command line npm config set registry https://registry.npm.taobao.org

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

5. Check the current mirror address again, and enter the command: npm config get registry

npm config get registry

 5. Return to vscode, reinstall jQuery, and enter the command line npm install jquery

npm install jquery

 Successful installation

Guess you like

Origin blog.csdn.net/m0_56905968/article/details/127898254