问题1

背景: 升级了mac后,出现git用不了的情况?
描述报错

  1. xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

解决方案

  1. 原因是因为每次更新系统之后xcode就被卸载了,因此需要重新安装一次。特此记录,以便查阅
  2. 在终端中输入: xcode-select --install

问题2

背景: 升级chrome后,https://localhost地址访问被阻止,并且无继续访问的如后, https协议无法通过;

描述报错

  1. 提示:您的连接不是私密连接?

解决方案

  1. chrome地址栏输入: chrome://flags
  2. 找到“Show in-form warnings for sensitive fields when the top-level page is not HTTPS”设置为 disabled
  3. 找到 Allow invalid certificates for resources loaded from localhost”设置为 enabled
  4. 点启用,然后重启浏览器方可解决

问题3

谷歌浏览器新版本Chrome 80默认SameSite导致跨域登录状态失效的问题; chrome 80 将sameSite设置成了Lax;
chrome80版本升级,如果存在跨站访问地址需要携带cookie,可能存在cookie无法正常携带;具体的解决方案

  1. localhost访问,可以设置chrome的配置;可以解决本地跨站携带cookie的问题

访问: chrome://flags/#same-site-by-default-cookies
image.png

  1. 对于生成的https协议的域名,跨站携带cookie,则需要后端设置对应的cookie

    步骤1: sameSite= none;
    步骤2:设置对应的安全协议为https; secure=true;

问题4

mac环境下,采用禁止跨域的限制。启用chrome的操作: 目前chrome版本81.0
命令:控制台执行:
open -a /Applications/Google\ Chrome.app —args —disable-web-security —user-data-dir=/Users/电脑名称/work/test

问题5

【React Native】 error Could not find “iPhone X” simulator. Run CLI with —verbose flag for more details。
解决方案: 由于本机模拟器没有安装iPhoneX, 调整device设备为本模拟安装了的配置; 并添加运行命令“react-native run-ios —simulator=’iPhone 11”; —simulator后面为设备模拟器对应的名称需要大小写一致

问题6

jest配置如果需要编译js,需要安装和配置babel的文件,如果报错import等Es6的引入有问题,检查

  1. 是否按照要求配置了babel
  2. babel的配置文件名字是不是合法

问题7 gyp: No Xcode or CLT version detected!

在前端项目中安装了包,报node错误,gyp: No Xcode or CLT version detected!
解决方案:
sudo rm -rf /Library/Developer/CommandLineTools xcode-select —install

问题8

最近遇到一个问题,prettier(1.19版本)+typescript(3.7版本)执行代码格式化时,对链式表达式报错(?.)。 在vscode

问题9 浏览器的缓存策略

image.png
https://www.cnblogs.com/zdz8207/p/vue-meta-no-cache.html

问题10 css hover动画,多种纬度效果

https://juejin.im/post/6861501624993447950

问题11 vue与vue-template-compiler版本号不一致,导致编译报错。 具体的报错内容

  1. 报错信息为:
  2. ERROR Error:
  3. Vue packages version mismatch:
  4. vue@2.6.10 (D:\softwares\node\node_global\node_modules\vue\dist\vue.runtime.common.js)
  5. vue-template-compiler@2.6.11 (D:\softwares\node\node_global\node_modules@vue\cli\node_modules\vue-template-compiler\package.json)
  6. This may cause things to work incorrectly. Make sure to use the same version for both.
  7. If you are using vue-loader@>=10.0, simply update vue-template-compiler.
  8. If you are using vue-loader@<10.0 or vueify, re-installing vue-loader/vueify should bump vue-template-compiler to the latest.

解决方法:

  1. 卸载vue-template-compiler@2.6.11
  2. 删除所有包
  3. 调整vue的版本为vue2.6.10。
  4. npm i vue-template-compiler@2.6.10 —save
  5. yarn

如果还不行, 则检查当前的vue-template-compiler的版本是否和vue的版本一直。保证版本一致性。

问题12 vue-cli接入mock

结局方案 https://juejin.im/post/6854573206884483086

问题13 chorme浏览器https协议报不安全

解决方法: 在浏览器上输入 thisisunsafe 则直接跳转到页面

问题14 npm link时报错: Error: EACCES: permission denied

解决方案: https://www.jianshu.com/p/aaa7db89a5b2

问题15 vscode在script处增加了,debug功能。 执行命令时,会开启js-debug功能,可能会存在报错。此时只需要关闭对应的命令。 就可以屏蔽掉debug功能
“debug.javascript.codelens.npmScripts”: “never”

image.png

问题15 env: python: No such file or directory -升级系统所致MacOS Monterey 12.3

https://blog.51cto.com/u_7075695/5269502