Jump to content

Installing using composer


NotionCommotion

Recommended Posts

Trying to install laravel, and was following a tutorial at https://www.tutorialspoint.com/laravel/laravel_installation.htm.  Why is --prefer-dist directory not being recognized as a flag, but is being used fort he target directory?  https://getcomposer.org/doc/03-cli.md#create-project shows doing something similar with php composer.phar create-project doctrine/orm path 2.2.*.  composer create-project --prefer-dist laravel/laravel blog described by https://laravel.com/docs/5.3 will install it in ./blog.

[Michael@devserver testl]$ pwd
/var/www/testl
[Michael@devserver testl]$ ls -la
total 8
drwxrwxr-x.  2 Michael Michael 4096 Nov 22 07:21 .
drwxrwxr-x. 28 root    root    4096 Nov 22 07:21 ..
[Michael@devserver testl]$ composer create-project laravel/laravel –-prefer-dist
Installing laravel/laravel (v5.3.16)
  - Installing laravel/laravel (v5.3.16)
    Loading from cache

Created project in –-prefer-dist
> php -r "file_exists('.env') || copy('.env.example', '.env');"
Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Installing vlucas/phpdotenv (v2.4.0)
etc, etc, etc....
    Loading from cache

symfony/var-dumper suggests installing ext-symfony_debug ()
phpunit/phpunit suggests installing phpunit/php-invoker (~1.1)
phpunit/phpunit suggests installing ext-xdebug (*)
Writing lock file
Generating autoload files
> Illuminate\Foundation\ComposerScripts::postUpdate
> php artisan optimize
Generating optimized class loader
The compiled class file has been removed.
> php artisan key:generate
Application key [base64:g+JF6MyWuEynyoyh//Afo1xg/2RiZSn5tF3cf1mQZp0=] set successfully.
[Michael@devserver testl]$ ls -la
total 12
drwxrwxr-x.  3 Michael Michael 4096 Nov 22 07:22 .
drwxrwxr-x. 28 root    root    4096 Nov 22 07:21 ..
drwxrwxr-x. 12 Michael Michael 4096 Nov 22 07:22 –-prefer-dist
[Michael@devserver testl]$
Link to comment
Share on other sites

The options are supposed to come first:

 

C:\>composer help create-project
Usage:
  create-project [options] [--] [<package>] [<directory>] [<version>]

 

Putting the --prefer-dist after works fine for me but maybe your version of composer is more picky? Are you using the latest version?

  • Like 1
Link to comment
Share on other sites

The options are supposed to come first:

 

Putting the --prefer-dist after works fine for me but maybe your version of composer is more picky? Are you using the latest version?

 

I'm using Composer version 1.2.0.

 

Even https://laravel.com/docs/5.1/quickstart shows it as composer create-project laravel/laravel quickstart --prefer-dist, however, since the directory is also given, it doesn't attempt to use the option as the directory path.

 

Oh well, all is good.  Thank you kicken for your reply.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.