mac上开发遇到的问题-散装笔记

总结以下自己遇到的问题,解决方法可能不适用于所有人

问题:
1、Permission denied
解决方法:
很明显,权限不足,如果要使用,通过如下命令进行授权即可:

sudo chmod -R 777 要操作的目录地址

2、在这里插入图片描述
解决方法:
GitHub的Preferences设置里

  1. github账户用自己的私有账户
  2. Git里的配置写公司的git帐号

公司项目的账号下面重装SSH

  1. Open a terminal on Linux or macOS, or Git Bash / WSL on Windows.

  2. Generate a new ED25519 SSH key pair:

  3. ssh-keygen -t ed25519 -C "email@example.com"

  4. Or, if you want to use RSA:

  5. ssh-keygen -o -t rsa -b 4096 -C "email@example.com"

  6. The -C flag adds a comment in the key in case you have multiple of them

  7. and want to tell which is which. It is optional. Next, you will be
    prompted to input a file path to save your SSH key pair to. If you
    don’t already have an SSH key pair and aren’t generating a deploy
    key, use the suggested path by pressing Enter. Using the suggested
    path will normally allow your SSH client to automatically use the
    SSH key pair with no additional configuration.

  8. If you already have an SSH key pair with the suggested file path,
    you will need to input a new file path and declare what host this
    SSH key pair will be used for in your ~/.ssh/config file.

  9. Once the path is decided, you will be prompted to input a password
    to secure your new SSH key pair. It’s a best practice to use a
    password, but it’s not required and you can skip creating it by
    pressing Enter twice.

  10. If, in any case, you want to add or change the password of your SSH
    key pair, you can use the -p flag:

  11. ssh-keygen -p -o -f

  12. Now, it’s time to add the newly created public key to your GitLab account.

在GitHub上重新拉取组件库

3、VSCode目录乱码问题
在这里插入图片描述
解决方法:
Mac 用户和 Linux 用户通过在您的终端中运行以下命令之一来安装。可以安装通过 curl 或 wget 命令行。
via curl

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

via wget

sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"

4、vscode 插件开发 typescript部分报错 Object is possibly ‘undefined’.
在tsconfig.js中:
strict设置false状态

{
    "compilerOptions": {
        "strict": false,
        //...
    }
}

5、
iTerm启动提示:zsh compinit 问题
问题日志:

[oh-my-zsh] For safety, we will not load completions from these directories until
[oh-my-zsh] you fix their permissions and ownership and restart zsh.
[oh-my-zsh] See the above list for directories with group or other writability.

[oh-my-zsh] To fix your permissions you can do so by disabling
[oh-my-zsh] the write permission of "group" and "others" and making sure that the
[oh-my-zsh] owner of these directories is either root or your current user.
[oh-my-zsh] The following command may help:
[oh-my-zsh]     compaudit | xargs chmod g-w,o-w

解决方法:
执行:

compaudit

查看一下列出的目录不安全的目录

然后执行以下语句给对应的目录赋权限即可

cd 不安全目录
sudo chmod -R 755 不安全目录

后边再启动iTerm就不会提示了。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值