douyuepi6485
2017-12-05 02:17 阅读 192
已采纳

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
  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

2条回答 默认 最新

  • 已采纳
    dongyuhui0418 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 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.

    点赞 评论 复制链接分享

相关推荐