1, preface
when I checked the laravel document, I saw that laravel Passport
implements API authentication, which is really good. However, when I actually installed it locally, I could not install it all the time, and the error message was described in the title, which was very annoying. Now I will record the solution process and solution.
, resolution process
error reporting begins at the first step of installing Passport
;
composer require laravel/passport
about Passport code> : http://laravelacademy.org/post/8298.html p>
1, composer version is not enough?
is suspected to be a problem with my own local composer version, so I decided to update it:
composer self-update
upgrades Composer
itself to the latest version, just run self-update
command. It will replace your composer. Phar
file to the latest version. Attempt to install failed after update.
2, is the downloaded version too high?
composer require laravel/passport (安装最新版本)
composer require laravel/passport ~4.0(安装4.0版本)
try with the lower version, as always error.
3, there is no stable version, must be compatible with the development version?
is added at the bottom of the composer. Json file:
"minimum-stability": "dev"
this section you can refer to the link: https://www.cnblogs.com/XACOOL/p/5627444.html p>
will not work even if the development version is compatible.
4, I am using the composer source is wrong, the file is wall?
because after downloading and installing composer
, the default is foreign mirror, so the connection speed of foreign websites is very slow, and they may be "walled" or even "non-existent" at any time. Therefore, it is suggested to use the domestic composer
source
reference link; https://pkg.phpcomposer.com/
, it still doesn't work to replace it with a domestic source.
Solution
Json is useless in composer. So is it the reason why
composer. Lock
?
1, about composer. Lock
use composer
to install PHP components and you will find that you have created a composer. Lock
file. What does this do?
composer. Lock is the version that records all installed PHP components. If multiple developers need to keep the downloaded version of PHP components to reduce unnecessary trouble, then composer. Lock
should be added to version control, such as using git or SVN. Not the other way around. It should be noted that when composer install
for component dependency, the composer. Lock
file will not be updated unless new components are introduced into composer. Json
.
, delete composer. Lock
try
1、把需要引入的包写入composer.json中
(写入的话,就不需要composer require了,直接composer update 即可。)
2、删除composer.lock
3、composer clearcache 清除缓存
4、composer update 更新依赖(重新生成composer.lock)
execute once according to the above scheme, and find that Passport
has been successfully installed. It seems that the composer. Lock
file has not been updated. Json is not directly modified in composer. Then try updating
with composer. It is really a mistake.
4. The second solution (I didn't try it myself) 1. If you manually update the composer. Json file, autoload:
composer dump-autoload
here refer to the link: https://segmentfault.com/q/1010000006974110 https://blog.csdn.net/sanbingyutuoniao123/article/details/52025565 Oliver: depth Composer portal https://www.cnblogs.com/XACOOL/p/5627444.html p> as for the second option, I haven't had a chance to try it myself. I just checked some materials and thought it might be ok. We can have a try and progress together! end
composer autoload code> document address: https://docs.phpcomposer.com/03-cli.html#dump-autoload p>
2. Execute the composer update command to update the dependency
composer install
and composer update
Read More:
- Composer require — dev barryvdh / laravel ide helper error resolution
- Idea running Flink program reported an error: static methods in interface require- target:jvm-1.8
- Composer update encountered “Script php artisan optimize handling the post-update-cmd event returne when upgrading laravel
- When using idea to start a project, an error is reported: Error:java : Compilation failed: internal java compiler error
- composer Error while processing content unencoding: Unknown failure within decompression softwar
- When angular4.0 starts the project, an error is reported: the “@ angular / compiler cli” package was not properly installed
- The MAC compiler Doris reported an error that thrift.annotation does not exist
- SSH suddenly fails to log in, and an error is reported: failed to start openssh daemon
- The installation of ThinkPHP reported an error. Could not find package topthink / think with stability stable
- When the mybatis field contains an expression, an error is reported when it is stored in the database
- An import error is reported in the python. The solution to setting. Pylintrc is invalid
- When installing pyaudio, an error is reported: failed error: portaudio. H: there is no such file or directory
- The docker installation es reported an error of failed; error = – cannot allocate memory ‘(errno = 12)
- Mex compiler error handling in MATLAB and GCC installation in Ubuntu
- Non 7z achieve. Error reported during CUDA installation. Solution: the installation file is damaged
- An error was reported during MySQL 6.0 installation: start service failed
- Because the computer is stuck, force to restart the computer and open idea idea to report an error on line 1: no content is allowed in the foreword.
- An error is reported when the laptop is turned on: image failed to verify with * access denied* press any key to continue
- Solve the problem of the C compiler identification is unknown or the cxx compiler identification is unknown in the process of using cmake
- An error is reported when the file in hive parquet format is written in the Flink connection