Solved: ERR! network request to https://registry.npmjs.org/@fortawesome%2fvue-fontawesome failed

1. Problem description:

First, the error is: During the operation of
configuring nodethe version and etc., it is found that no matter whether it is installing dependencies or running the project, an error is reported:node-sasselement-plus
ERR! network request to https://registry.npmjs.org/@fortawesome%2fvue-fontawesome failed ERR! network This is a problem related to network connectivity.

Chinese is:

错误! 对 https://registry.npmjs.org/@fortawesome%2fvue-fontawesome 的网络请求失败; 错误! 网络 这是与网络连接相关的问题;

Second, the error display is as follows:

insert image description here

2. Problem analysis:

According to the prompt, it should be a problem with the network, and see if it can be pingconnected . If there is still a problem, consider replacing the mirror image and other issues (because node.jsthe site is abroad, and Taobao mirror is generally used in China );

3. Problem solving:

pingFirst , let’s see if there is really a problem with the network service:

// display can pingpass www.baidu.com;

insert image description here

// display can pingpass registry.npmjs.org;

insert image description here

// display can pingpass registry.npm.taobao.org;

insert image description here

Second, according to the pingabove results, it should not be a network problem (but if the above pingdoes not work, then it is 网络的问题, or 关机重启下);

Third, if there is no problem with the network, there is a high probability that it is 镜像a problem. Execute the following statements in sequence (want to npmjsswitch to taobao):

A. First check the current mirror image: command: npm config get registry, mirror image:https://registry.npmjs.org/

insert image description here

B. Execute the following commands one by one. If it is displayed nullas execute 下一步 C、it, otherwise execute the code in the brackets 下一步 C、:

npm config get proxy

insert image description here

npm config get https-proxy

insert image description here

    // The command here is: change the above display value 非 nullto 归 null;
       npm config set proxy null
       npm config set https-proxy null

C. Install Taobao image:

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

insert image description here

npm config get registry

At this point the mirror image becomes taobaoa mirror image :http://registry.taobao.org/

insert image description here

// Execute nmp installthe command , and node_modulesthe file should be successfully generated;

D. If the problem of this error is still not resolved by this time ( 我的就是这样的):

It is suggested 重启一次that in windowsthe system , 重启能解决 99%the stubborn problem, my error is solved in this way;

4. Summary:

First, where there is something wrong or inappropriate, please give me some pointers and exchanges!
Second, if you are interested, you can pay more attention to this column (Vue (Vue2+Vue3) interview must-have column):https://blog.csdn.net/weixin_43405300/category_11525646.html?spm=1001.2014.3001.5482

Guess you like

Origin blog.csdn.net/weixin_43405300/article/details/131121677