常见bug记录

本文记录在操作系统、浏览器中常见的bug及其解决方案。

1.github中网址前缀为raw.githubusercontent.com的资源(图片、文档等)无法访问。

解决方案:

根据 解决 raw.githubusercontent.com 无法访问的问题,可能是由于某些原因导致 DNS 被污染,Windows系统上可以通过修改 hosts 文件解决该问题,步骤如下:

  • 1)通过 IPAddress.com 查询域名 raw.githubusercontent.com所在网址:

image-20220513014334969

  • 2)在路径 C:\Windows\System32\drivers\etc下的hosts文件最后一行添加如下信息:

    185.199.108.133 raw.githubusercontent.com

    PS:可能hosts文件为只读文件,此时需要右键单击hosts文件修改其访问权限。


2.在 Windows10 系统中,当默认浏览器设置为谷歌浏览器时,偶尔会出现点击其他应用(如飞书,TIM等)的链接无法跳转到谷歌浏览器打开此链接的情况。

解决方案:重启电脑


3.在Windows 10系统中,当使用git bash终端进行package的安装和初始化时,无法在选项之间切换,如下图所示,无法在 No/Yes 的两个选项之间切换:

image-20220515153036885

查询资料可知,git bash终端并不提供交互功能,因此无法进行选项切换。

解决方案:使用cmd或者其他的终端

参考资料:

  1. Can’t use arrow keys in Git Bash (Windows)

4.在 Convertio 进行文件转换时,转换完成后在点击文件下载按钮后会跳转到 403 Forbidden 页面,如下图所示:

image-20220515162921157

推测原因:在通过 ssr 挂代理后,Convertio 不允许代理 ip 进行文件下载

解决方案:关闭 ssr 代理


5.在使用 VSCode 编辑器进行开发时,常常会遇到编辑环境变量并保存后在 VSCode 终端中环境变量并未同步更新的情况,即使关闭 VSCode 后重新打开也是如此,如下图所示,在将gcc.exe所在bin添加到环境变量后在 VSCode 终端中并没有更新:

image-20220516004330258

猜测:VSCode 将之前的环境变量缓存起来,在重新启动 VSCode 后环境变量并未及时更新

解决方案:安装 Chocolatey 并运行refreshenv 命令更新环境变量

步骤:

  • 关闭代理(在打开代理的情况下安装策略不同)

  • 以管理员身份运行cmd并运行如下命令:

    @"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
  • 关闭cmd终端后重新打开以更新Chocolatey配置

  • 在打开的cmd终端中运行refreshenv更新环境变量:

    image-20220516004936734

  • cmd终端中运行code启动 VSCode

  • 在打开的 VSCode 的cmd终端中运行gcc发现环境变量更新成功:

    image-20220516005208707

PS:遗憾的是,通过右键文件夹打开 VSCode 环境变量仍然未更新

参考资料:

  1. VS Code Refresh Integrated Terminal Environment Variables without Restart/Logout
  2. Installing Chocolatey
  3. Is there a command to refresh environment variables from the command prompt in Windows?

6.powershell启动时出现以下报错信息:

File D:\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1 cannot be loaded because running scripts is disabled on this system
  • 以管理员身份打开powershell
  • 运行set-executionpolicy remotesigned
  • 键入A (Yes to All) 并回车

参考资料:

  1. What’s Wrong With My Windows PowerShell

7.IDM 总是在浏览器中下载f.txt文件。

原因:

在五年之前,在全世界的许多网站上都会显示Google 的广告,但由于谷歌广告系统的一个小 error,广告可能不会显示,而是将 code 下载到一个 txt 文件中,Google 已经采取措施解决了这个问题;五年前在 Firefox 浏览器上也出现了这个问题,但过几天就被解决了。对使用各种浏览器的用户来说,当浏览各种类型的网站时这个问题偶尔会发生,但是没有什么风险。

解决方案:

  • 清楚浏览器缓存
  • 更新浏览器到最新版本
  • 进行全面的病毒扫描

参考资料:

  1. F.txt Help! Computer keeps downloading “f.txt” file…
  2. Google Chrome forcing download of “f.txt” file

8.打开 Microsoft Store 时出现 0x800704cf 错误,如下图所示:

image-20220608231526381

参考资料:

  1. 0x800704cf

9.当默认浏览器为google时,点击其他应用内的链接无法跳转到浏览器。 解决方案:在系统设置默认应用里将Web browser改为其他浏览器,发现可以正常跳转链接,然后改回为google,重启电脑 ![](https://raw.githubusercontent.com/Tom89757/ImageHost/main/hexo/20220917112759.png)

参考资料:

  1. win10点击超链接无法跳转到浏览器

10.点击Windows10 OneDrive应用没有反应 > 参考资料: > 1. [OneDrive无法打开的原因](https://zhuanlan.zhihu.com/p/343335173)
在git bash终端运行java程序无法通过`Ctrl+Z`终止`hasNext()`输入,如下图所示: ![](https://raw.githubusercontent.com/Tom89757/ImageHost/main/hexo/20221001224702.png) 其原因在于git bash不支持通过`Ctrl+Z`发送Signal 18即`SIGTSTP`信号。在cmd中运行会发现`Ctrl+Z`后回车可以正常终止输入: ![](https://raw.githubusercontent.com/Tom89757/ImageHost/main/hexo/20221001225100.png)

参考资料:

  1. python error Suppressing signal 18 to win32

11.使用conda创建新环境时出现以下报错: ![](https://raw.githubusercontent.com/Tom89757/ImageHost/main/hexo/20221016160914.png) 1. `conda clean -i` 2. 删除`.condarc`文件,关闭代理 3. 重新打开Anaconda Prompt窗口,运行命令创建新环境。(此时删除了所有镜像,使用官方源进行安装,未尝试镜像源安装) > 参考资料: > 1. [conda install packages error: Collecting package metadata (current_repodata.json): failed](https://stackoverflow.com/questions/61134985/conda-install-packages-error-collecting-package-metadata-current-repodata-json) > 2. [Managing channels](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-channels.html)
12.安装`pydensecrf`pip包时出现如下报错: ![](https://raw.githubusercontent.com/Tom89757/ImageHost/main/hexo/20221025102938.png) 提示`Microsoft Visual C++ 14.0 or greater is required`。 解决方案: 1. 按照参考资料3安装对应Visual Studio工具 安装后使用`pip install pydensecrf`安装出现新的报错: ![](https://raw.githubusercontent.com/Tom89757/ImageHost/main/hexo/20221025111316.png) 2. 参照参考资料4将`pydensecrf-1.0rc2-cp38-cp38-win32.whl`下载到本地安装后出现如下报错: ![](https://raw.githubusercontent.com/Tom89757/ImageHost/main/hexo/20221025111520.png) 更换为`amd64.whl`版本后解决。 > 参考资料: > 1. [Error "Microsoft Visual C++ 14.0 is required (Unable to find vcvarsall.bat)"](https://stackoverflow.com/questions/29846087/error-microsoft-visual-c-14-0-is-required-unable-to-find-vcvarsall-bat) > 2. [Pip error: Microsoft Visual C++ 14.0 is required](https://stackoverflow.com/questions/44951456/pip-error-microsoft-visual-c-14-0-is-required) > 3. [Error "Microsoft Visual C++ 14.0 is required (Unable to find vcvarsall.bat)"](https://stackoverflow.com/questions/29846087/error-microsoft-visual-c-14-0-is-required-unable-to-find-vcvarsall-bat) > 4. [Pydensecrf 安装报错_MenahemLi的博客-CSDN博客](https://blog.csdn.net/qq_36978986/article/details/108130879) > 5. [Archived: Python Extension Packages for Windows - Christoph Gohlke](https://www.lfd.uci.edu/~gohlke/pythonlibs/#pydensecrf)
13.运行`npm install package-name`时,卡在`sill idealTree buildDeps`没有反应。 解决方案: - 配置淘宝镜像:`npm config set registry https://registry.npm.taobao.org ` - 检验镜像配置:`npm config get registry ` - 继续运行:`npm install`。 - 如果问题仍然存在,运行:`npm set strict-ssl false` > 参考资料: > 1. [1.运行npm install 时,卡在sill idealTree buildDeps没有反应_豆豆豆豆芽的博客-CSDN博客](https://blog.csdn.net/weixin_46182244/article/details/121302702) > 2. [[BUG] "sill idealTree buildDeps" takes a lot of time a project with workspaces · Issue #3257 · npm/cli · GitHub](https://github.com/npm/cli/issues/3257)
14.出现`RuntimeError: latex was not able to process the following string`: ![](https://raw.githubusercontent.com/Tom89757/ImageHost/main/hexo/20221121004755.png) 解决方案:安装MiKTeX并添加到环境变量。(安装正版LaTeX更好) > 参考资料: > 1. [Getting MiKTeX](https://miktex.org/download)
15.Clash for Windows端口为0且无法更改,导致代理不可用: ![](https://raw.githubusercontent.com/Tom89757/ImageHost/main/hexo/20221121235520.png) 原因:系统更新后,由于使用`Hyper-V`的功能,虚拟机需要映射一部分端口,并且在系统更新后对动态映射的端口进行了更改,导致占用了本来的`Clash`使用的端口。 解决方案:更改系统进行动态映射的端口范围 - cmd中`netsh int ipv4 show dynamicport tcp`,可以发现系统更新后动态端口范围变为从1024开始,导致原先的1080端口被占用 - `netsh int ipv4 set dynamicport tcp start=49152 num=16383`,将为tcp协议分配的端口范围进行更改 - `netsh int ipv4 set dynamicport udp start=49152 num=16383`,将为udp协议分配的端口范围进行更改 - `netsh interface ipv4 show excludedportrange protocol=tcp`,结果如下: ![](https://raw.githubusercontent.com/Tom89757/ImageHost/main/hexo/20221122000350.png) - 说明此时端口设置已经更新,重启电脑后可以在Clash中对端口进行设置。 >就参考资料: >1. [解决 Clash for windows 端口为 0 导致无法使用_51CTO博客_clash for windows连不上](https://blog.51cto.com/frytea/4146902) >2. [Clash For Windows代理端口为0问题 - 寒梦](https://siegelion.cn/2022/01/31/Clash%20For%20Windows%E4%BB%A3%E7%90%86%E7%AB%AF%E5%8F%A3%E4%B8%BA0%E9%97%AE%E9%A2%98/)
16.v2rayN出现`v2rayN tcp:127.0.0.1: rejected proxy/socks: unknow Socks version`刷屏: ![](https://raw.githubusercontent.com/Tom89757/ImageHost/main/hexo/20221121235442.png) 问题:系统的代理设置协议为`http`和`https`协议,而v2rayN只支持`socks5`协议,导致出错。 解决方案:将系统代理设置协议更改为`socks5`,或者将代理软件改为SSR或者Clash,此二者同时支持`http`和`socks5`协议。 > 参考资料: > 1. [如何解决“rejected v2ray.com/core/proxy/socks: unknown Socks version: ”的问题 - Xuing的个人博客](https://xuing.cn/security/v2ray_unknown_socks.html)

17.桌面出现Microsoft OneNote Namespace Extension for Windows Desktop Search文件夹无法删除。

参考资料:

  1. Can’t delete “Microsoft OneNote Namespace Extension for Windows Desktop Search” from desktop - automatically gets restored - Super User

18.Windows系统删除文件时出现`该项目不在XX中,请确认该项目的位置然后重试`。 解决方案见参考资料: > 参考资料: > 1. [解决删除文件时出现“该项目不在XX中,请确认该项目的位置然后重试”的提示-阿里云开发者社区](https://developer.aliyun.com/article/910256)
19.windows10无法编辑系统环境变量(Can't edit system variables) 解决方案:`Win+X -> Y -> Advanced system settings`进入编辑 > 参考资料: > 1. [Redirecting](https://answers.microsoft.com/en-us/windows/forum/all/cant-edit-environment-variables-in-windows-10/29ca1561-5c4d-4c0d-ab93-808411a062a3)
20.VSCode Copilot报错`GitHub Copilot could not connect to server. Extension activation failed: "Unexpected token 'N', "Not Found" is not valid JSON"`

参考资料:

  1. VSCode Extension GitHub Copilot could not connect to server · community · Discussion #14305 · GitHub