This is the 24th day of my participation in Gwen Challenge
preface
When developing Vue on a Mac, the VS Code editor will use NVM, so installing NVM on a Mac is a must, but developers unfamiliar with the installation process will encounter some error problems.
The problem
Curl: (7) Failed to connect to… curl: (7) Failed to connect to… Solution, hint at the core of the error message is: curl: (7) Failed to connect to port 443 raw.githubusercontent.com: Connection refused
The specific error information is as follows:
admin ~ % curl -L get.rvm.io | bash -s stable
% Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed
100 194 100 194 0 0 124 0 0:00:01 0:00:01 --:--:-- 124
0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0
curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused
source: no such file or directory: /Users/admin/.bashrc
source: no such file or directory: /Users/admin/.bash_profile
Copy the code
Problem analysis
After analyzing the error message, it is concluded that the DNS resolution of some GitHub domain names is contaminated. As a result, the DNS resolution process cannot obtain the correct IP address through the domain name, which causes the installation failure. The failure is caused by the failure of initialization.
Solving steps
The specific solution steps are as follows:
1. Open the link www.ipaddress.com/ and input in web access domain, namely raw.githubusercontent.com;
2. Check the domain name raw.githubusercontent.com, the IP address of the corresponding correct;
3. Then replace the system host file in the host file on the Mac, open Finder, and use the Shift + Command+ G shortcut keys to go to the folder, enter /etc/hosts, and click “Go”.
Go to the directory where the hosts file resides and double-click the hosts file.
- In the hosts file open on the local computer, fill in:
199.232.68.133 raw.githubusercontent.com
199.232.68.133 user-images.githubusercontent.com
199.232.68.133 avatars22.githubusercontent.com
199.232.68.133 avatars11.githubusercontent.com
Copy the code
5. Then save the file, and you can install NVM successfully.
The above is all the content of this article. Welcome to follow the wechat public account of Sanzhan “Program Ape by Sanzhan”, and the Sina Weibo account of Sanzhan “Sanzhan 666”, welcome to follow!