由于某个项目想移除某个扩展包,但一直报版本不兼容错导致移除不了。报错如下图。后面只要在移除包compooser语句后面加 --ignore-platform-reqs即可,命令:composer remove xxxxxx --ignore-platform-reqs。
移除扩展包后,执行php artisan config:clear和composer dump-autoload,想重装新扩展包发现报错in COntainer.php line 790:Class request does not exist。原因是移除扩展包造成了影响,可能项目升级过laravel版本,底层框架文件没同步。
只要在目录路径:/vendor/laravel/framework/src/Illuminate/Foundation/PackageManifest.php找到PackageManifest.php文件中build()方法
if (
t
h
i
s
−
>
f
i
l
e
s
−
>
e
x
i
s
t
s
(
this->files->exists(
this−>files−>exists(path = KaTeX parse error: Expected '}', got 'EOF' at end of input: … = json_decode(this->files->get($path), true);
}
修改成:
if (
t
h
i
s
−
>
f
i
l
e
s
−
>
e
x
i
s
t
s
(
this->files->exists(
this−>files−>exists(path = $this->vendorPath.‘/composer/installed.json’)) {
i
n
s
t
a
l
l
e
d
=
j
s
o
n
d
e
c
o
d
e
(
installed = json_decode(
installed=jsondecode(this->files->get($path), true);
$packages = $installed['packages'] ?? $installed;
}
修改好后,重新执行移除扩展包即可。@TOC