douyuepi6485
2017-12-05 02:17
浏览 215
已采纳

composer dump-autoload not recognized命令

whenever I use composer dump-autoload with laravel I get this error

Generating optimized autoload files

Illuminate\Foundation\ComposerScripts::postAutoloadDump @php artisan package:discover 'C:\Program' is not recognized as an internal or external command, operable program or batch file. Script @php artisan package:discover handling the post-autoload-dump event returned with error code 1

I think it has something to do with "environment variables"

so my paths

C:\ProgramData\Oracle\Java\javapath;
C:\Program Files\iis express\PHP\v7.0;
C:\WINDOWS\system32;
C:\WINDOWS;
C:\WINDOWS\System32\Wbem;
C:\WINDOWS\System32\WindowsPowerShell\v1.0\;
C:\Program Files (x86)\QuickTime\QTSystem\;
C:\xampp\php;
C:\ProgramData\ComposerSetup\bin;
C:\Android;C:\Windows\System32;
C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;
C:\ProgramFiles\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn\;
C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\;
C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;
C:\Program Files\Microsoft SQL Server\120\DTS\Binn\;
C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\ManagementStudio\;
C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\;
C:\Users\ahmadz\AppData\Roaming\Composer\vendor\bin;
C:\Users\ahmadz\AppData\Local\Microsoft\WindowsApps;
C:\Program Files\Git\cmd;
C:\Program Files (x86)\Skype\Phone\;
C:\Program Files (x86)\Brackets\command;
C:\Program Files
odejs\;
C:\ProgramFiles\Microsoft SQL Server\130\Tools\Binn\;
C:\Program Files\dotnet\;
C:\Users\ahmadz\AppData\Roaming\Composer\vendor\bin;
C:\Users\ahmadz\AppData\Local\Microsoft\WindowsApps;
C:\xampp\php;
C:\Users\ahmadz\AppData\Roaming\Composer\vendor\bin\phpspec run;
C:\Users\ahmadz\AppData\Roaming
pm;
C:\Users\ahmadz\AppData\Roaming\Composer\vendor\bin\kahlan

图片转代码服务由CSDN问答提供 功能建议

每当我使用带有laravel的composer dump-autoload时我都会收到此错误

生成优化的自动加载文件

Illuminate \ Foundation \ ComposerScripts :: postAutoloadDump @php artisan包:发现'C:\ Program'不是 被识别为内部或外部命令,可操作程序或批处理文件。 脚本 @php artisan包:发现处理后自动加载转储事件 返回错误代码1

我认为它 与“环境变量”有关

所以我的路径

  C:\ ProgramData \ Oracle \ Java \ javapath; 
C  :\ Program Files \ iis express \ PHP \ v7.0; 
C:\ WINDOWS \ system32; 
C:\ WINDOWS; 
C:\ WINDOWS \ System32 \ Wbem; 
C:\ WINDOWS \ System32 \ WindowsPowerShell \ v1。  0 \; 
C:\ Program Files(x86)\ QuickTime \ QTSystem \; 
C:\ xampp \ php; 
C:\ ProgramData \ ComposerSetup \ bin; 
C:\ Android; C:\ Windows \ System32; \  nC:\ Program Files(x86)\ NVIDIA Corporation \ PhysX \ Common; 
C:\ ProgramFiles \ Microsoft SQL Server \ Client SDK \ ODBC \ 110 \ Tools \ Binn \; 
C:\ Program Files(x86)\ Microsoft SQL  Server \ 120 \ Tools \ Binn \; 
C:\ Program Files \ Microsoft SQL Server \ 120 \ Tools \ Binn \; 
C:\ Program Files \ Microsoft SQL Server \ 120 \ DTS \ Binn \; 
C:\ Program 文件(x86)\ Microsoft SQL Server \ 120 \ Tools \ Binn \ ManagementStudio \; 
C:\ Program Files(x86)\ Microsoft SQL Server \ 120 \ DTS \  Binn \; 
C:\ Users \ ahmadz \ AppData \ Roaming \ Composer \ vendor \ bin; 
C:\ Users \ ahmadz \ AppData \ Local \ Microsoft \ WindowsApps; 
C:\ Program Files \ Git \ cmd; 
C  :\ Program Files(x86)\ Skype \ Phone \; 
C:\ Program Files(x86)\ Brackets \ command; 
C:\ Program Files 
odejs \; 
C:\ ProgramFiles \ Microsoft SQL Server \ 130 \ Tools  \ Binn \; 
C:\ Program Files \ dotnet \; 
C:\ Users \ ahmadz \ AppData \ Roaming \ Composer \ vendor \ bin; 
C:\ Users \ ahmadz \ AppData \ Local \ Microsoft \ WindowsApps; 
C  :\ xampp \ php; 
C:\ Users \ ahmadz \ AppData \ Roaming \ Composer \ vendor \ bin \ phpspec run; 
C:\ Users \ ahmadz \ AppData \ Roaming 
pm; 
C:\ Users \ ahmadz \ AppData  \ Roaming \ Composer \ vendor \ bin \ kahlan 
   
 
 
 
 
 
 
 
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • dongyuhui0418 2017-12-05 09:46
    已采纳

    With Paul Santos answer you will only update all global packages. To update your composer installation you need to use

    composer selfupdate
    
    已采纳该答案
    打赏 评论
  • duanfen2008 2017-12-05 03:20

    You're composer might be outdated. Try running this script in your terminal

    composer global update
    

    Then run composer update in your project folder.

    打赏 评论

相关推荐 更多相似问题