淘先锋技术网

首页 1 2 3 4 5 6 7

快捷键

命令行作用
control+A/E移到命令的行首、行尾
control+U清除命令

1、网络问题

(1)ssl_error_syscall in connection to raw.githubusercontent.com:443

禁用IPV6:networksetup -setv6off Wi-Fi
ssl_error_syscall in connection to raw.githubusercontent.com:443

(2)pip安装python库显示ssh问题

解决办法
建立文件~/.pip/pip.config并且更改文件权限:sudo chmod 755 pip.conf,在该文件中进行如下配置:

[global]
index-url = http://pypi.douban.com/simple #豆瓣源,可以换成其他的源
extra-index-url = https://pypi.tuna.tsinghua.edu.cn/simple
trusted-host = 
    pypi.douban.com            #添加豆瓣源为可信主机,要不然可能报错
    pypi.tuna.tsinghua         #清华
timeout = 120

(3) Unable to add a source with url https://github.com/CocoaPods/Specs.git named cocoapods.

可以先在~/.cocoapods/repos/目录通过git clone https://github.com/CocoaPods/Specs.git master下载到本地

2、shell相关

(1)为.sh脚本文件创建别名

首先给脚本文件添加执行权限:chmod +x <file>,然后在~/.zshrc中添加:alias <别名>="xxx/<file>"

(2)WARNING: The scripts pip, pip3 and pip3.8 are installed in ‘/Users/[name]>/Library/Python/3.8/bin’ which is not on PATH.

  • › echo 'export PATH=/Users/[name]/Library/Python/3.8/bin:$PATH' >>~/.zshrc
  • › python3 -m pip install --upgrade --force-reinstall pip更新pip

(3)Insecure world writable dir /opt/homebrew/bin in PATH, mode 040777

利用chmod go-w /opt/homebrew/bin解决,表示移除group和others对文件的write权限。

3、 Homebrew相关问题

(1)brew install node时提示tar的问题,可以brew update

RequestError: connect ETIMEDOUT/socket hang up往往是代理的问题,可以执行npm config set proxy null,不行的话直接npm config delete proxy

(2) pip No module named typing

curl -O https://bootstrap.pypa.io/pip/2.7/get-pip.py
python get-pip.py
python -m pip install --upgrade "pip < 21.0"

之后使用sudo easy_install requestspip2.7 install prettytable等,可以为python2.7安装库。

4、M1问题

(1)pod install遇到 [!] Oh no, an error occurred.

先执行sudo arch -x86_64 gem install ffi,以后在pod install之前加上arch -x86_64,嫌麻烦可配置alias。