0

I am trying to install twig with composer on CENTOS 6.7 getting this error , what am I doing wrong ?:

[root@mankomal /]# composer require twig/twig
Running composer as root/super user is highly discouraged as packages, plugins and scripts cannot always be trusted

Using version ^1.24 for twig/twig
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)

Installation failed, deleting ./composer.json.


  [RuntimeException]   //vendor does not exist and could not be created.


  require [--dev] [--prefer-source] [--prefer-dist] [--no-progress]
  [--no-update] [--update-no-dev] [--update-with-dependencies]
  [--ignore-platform-reqs] [--sort-packages] [-o|--optimize-autoloader]
  [-a|--classmap-authoritative] [--] [<packages>]...
kenorb
  • 155,785
  • 88
  • 678
  • 743
  • 2
    looks like you are executing the command from the root directory (`/`) and composer is unable to create /vendor there. shouldn't you be running the command from your project's directory instead of doing it from the root directory? – Oliver Maksimovic Jun 08 '16 at 07:59
  • You can use composer as root, but you should not. Composer manage local library sets, so you do not need to have super user privileges. – Daniel Jun 08 '16 at 12:01

1 Answers1

0

Looks like your vendor dir isn't correct.

Suggestions:

  • Double check your COMPOSER_VENDOR_DIR environment variable. Try to unset it.
  • Double check your vendor-dir in your composer.json.

See: How to specify Composer install path?

kenorb
  • 155,785
  • 88
  • 678
  • 743