duanchique1196 2018-06-28 17:00
浏览 580

无法在laravel项目中安装composer

I am new in Php and start working on laravel based project but facing one issue when installing composer on project level (I am using Phpstrom Ide).

composer install --no-interaction --ansi  Loading composer repositories with package information  Installing dependencies (including require-dev) from lock file  Nothing to install or update  Generating optimized autoload files  > Illuminate\Foundation\ComposerScripts::postInstall  > php artisan optimize  Script php artisan optimize handling the post-install-cmd event returned with error code 1  Failed to install packages for ./composer.json.

Process :-

  1. Install composer and wamp server
  2. Hit this command in order to create laravel project

composer create-project laravel/laravel --prefer-dist

and project is created with this error and no vendor folder is created

Installing laravel/laravel (v5.4.30) - Installing laravel/laravel (v5.4.30): Downloading (100%) Created project in C:\wamp64\www\laravel

php -r "file_exists('.env') || copy('.env.example', '.env');" Script php -r "file_exists('.env') || copy('.env.example', '.env');" handling th e post-root-package-install event returned with error code 1

  1. I hit the composer command for Install and get first issue in this post

Composer -v

PHP temp directory (D:\mysql\temp) does not exist or is not writable to Composer . Set sys_temp_dir in your php.ini Composer version 1.6.5 2018-05-04 11:44:59

composer -version

PHP temp directory (D:\mysql\temp) does not exist or is not writable to Composer . Set sys_temp_dir in your php.ini

[Symfony\Component\Console\Exception\RuntimeException] The "-e" option does not exist.

Exception trace: () at phar://C:/composer/composer.phar/vendor/symfony/console/Input/ArgvInput.p hp:124 Symfony\Component\Console\Input\ArgvInput->parseShortOptionSet() at phar://C:/c omposer/composer.phar/vendor/symfony/console/Input/ArgvInput.php:105 Symfony\Component\Console\Input\ArgvInput->parseShortOption() at phar://C:/comp oser/composer.phar/vendor/symfony/console/Input/ArgvInput.php:84 Symfony\Component\Console\Input\ArgvInput->parse() at phar://C:/composer/compos er.phar/vendor/symfony/console/Input/Input.php:54 Symfony\Component\Console\Input\Input->bind() at phar://C:/composer/composer.ph ar/vendor/symfony/console/Command/Command.php:200 Symfony\Component\Console\Command\Command->run() at phar://C:/composer/composer .phar/vendor/symfony/console/Application.php:843 Symfony\Component\Console\Application->doRunCommand() at phar://C:/composer/com poser.phar/vendor/symfony/console/Application.php:193 Symfony\Component\Console\Application->doRun() at phar://C:/composer/composer.p har/src/Composer/Console/Application.php:251 Composer\Console\Application->doRun() at phar://C:/composer/composer.phar/vendo r/symfony/console/Application.php:117 Symfony\Component\Console\Application->run() at phar://C:/composer/composer.pha r/src/Composer/Console/Application.php:100 Composer\Console\Application->run() at phar://C:/composer/composer.phar/bin/com poser:59 require() at C:\composer\composer.phar:24

list [--xml] [--raw] [--format FORMAT] [--] []

  • 写回答

2条回答 默认 最新

  • dousha1394 2018-06-28 19:00
    关注

    It seems that composer is not properly installed on your environment...

    Follow the official documentation and try again to install your dependencies.

    Let me know if this solution worked.

    评论

报告相同问题?

悬赏问题

  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算
  • ¥15 java如何提取出pdf里的文字?