每次发博客就代表本人又经历了一次4h+的解决报错大革命。。报错是每天都有的,但是大报错。。我真的要哭了呜呜呜,4h+是有点夸张成分的,我是改完另一个报错接着又出现这个报错才花那么长时间的,当然改报错能改那么久有个原因是我菜 嘿嘿,收!开始正文
其实主要想说的是关于“This dependency was not found”这个报错,不一定有用,也是多给大家一个解决途径吧~
我当时的报错如下图
然后看到最后一行大家第一反应肯定就是执行npm install --save mock/user这个命令
我也是这么想,先配置了github密钥又下载这个包,结果还是显示这个报错,又下载又报错
思路
有可能是你在写代码时vscode自动帮你引入了某个东西
所以我们使用快捷键全局搜索这个配置
ctrl + shift + f 键(全局搜索操作)
vscode左边就会弹出这个框,输入报错的这个配置
接着我就发现系统帮我自动引入了mock/user,删掉这行就没报错了
希望帮助到大家~
这个解决方法看起来好蠢,大家别骂我,我也觉得好蠢啊啊啊真没想到这一步,还花了那么多时间重装更新yarn 配置密钥 安装包。。