Hi there,

I'm new to D8 and Composer so, I'm playing around with an installation to learn.

Just managed to create a new project as per instructions at https://www.drupal.org/docs/develop/using-composer/using-composer-to-ins...

I used this command and I received a congratulations message

composer create-project drupal/recommended-project:8.9.6 barb

I did the set up using the standard web interface and the site is up an running without any error

Then I tried to install the module Admin Toolbar at https://www.drupal.org/project/admin_toolbar with 

composer require drupal/admin_toolbar

 and got this error

[InvalidArgumentException]
  Could not find a matching version of package drupal/admin_toolbar. Check the package spelling, your version constraint and that the package is available in a stability which matches your minimum-stability (stable).

Also tried to install the module SMTP Authentication Support at https://www.drupal.org/project/smtp using

composer require drupal/smtp

and got the same error

[InvalidArgumentException]
  Could not find a matching version of package drupal/smtp. Check the package spelling, your version constraint and that the package is available in a stability which matches your minimum-stability (stable).

Both of the command lines were taken from the modules' project pages 

I'm in a shared hosting and doing this installation in using subdomain like sub.mydomain.com

I'd think I'm obviously doing something wrong.

I'm no programmer, I've developed a few D7 sites and starting to play around with D8 and Composer for a new project that I will be starting soon and I'd like to do it this way.

What am I doing wrong? Anyone could point me in the right direction?

Thanks
Manu

Comments

mmjvb’s picture

See protocol:

docker@cli:/var/www$ composer create-project drupal/recommended-project:8.9.6 barb
    Finished: success: 1, skipped: 0, failure: 0, total: 1
    Finished: success: 1, skipped: 0, failure: 0, total: 1
Creating a "drupal/recommended-project:8.9.6" project at "./barb"
Installing drupal/recommended-project (8.9.6)
  - Installing drupal/recommended-project (8.9.6): Downloading (100%)
Created project in /var/www/barb
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
    Finished: success: 31, skipped: 0, failure: 0, total: 31
Package operations: 59 installs, 0 updates, 0 removals
  - Installing composer/installers (v1.9.0): Loading from cache
  - Installing drupal/core-composer-scaffold (8.9.6): Loading from cache
  - Installing drupal/core-project-message (8.9.6): Loading from cache
  - Installing typo3/phar-stream-wrapper (v3.1.4): Loading from cache
  - Installing symfony/polyfill-ctype (v1.17.0): Loading from cache
  - Installing twig/twig (v1.42.5): Loading from cache
  - Installing symfony/yaml (v3.4.41): Loading from cache
  - Installing symfony/polyfill-mbstring (v1.17.0): Loading from cache
  - Installing symfony/translation (v3.4.41): Loading from cache
  - Installing symfony/validator (v3.4.41): Loading from cache
  - Installing symfony/serializer (v3.4.41): Loading from cache
  - Installing symfony/routing (v3.4.41): Loading from cache
  - Installing paragonie/random_compat (v9.99.99): Loading from cache
  - Installing symfony/polyfill-php70 (v1.17.0): Loading from cache
  - Installing symfony/http-foundation (v3.4.41): Loading from cache
  - Installing psr/http-message (1.0.1): Loading from cache
  - Installing symfony/psr-http-message-bridge (v1.1.2): Loading from cache
  - Installing symfony/process (v3.4.41): Loading from cache
  - Installing symfony/polyfill-util (v1.17.0): Loading from cache
  - Installing symfony/polyfill-php72 (v1.17.0): Loading from cache
  - Installing symfony/polyfill-php56 (v1.17.0): Loading from cache
  - Installing symfony/polyfill-intl-idn (v1.17.0): Loading from cache
  - Installing symfony/polyfill-iconv (v1.17.0): Loading from cache
  - Installing symfony/event-dispatcher (v3.4.41): Loading from cache
  - Installing psr/log (1.1.3): Loading from cache
  - Installing symfony/debug (v3.4.41): Loading from cache
  - Installing symfony/http-kernel (v3.4.44): Loading from cache
  - Installing psr/container (1.0.0): Loading from cache
  - Installing symfony/dependency-injection (v3.4.41): Loading from cache
  - Installing symfony/console (v3.4.41): Loading from cache
  - Installing symfony/class-loader (v3.4.41): Loading from cache
  - Installing symfony-cmf/routing (1.4.1): Loading from cache
  - Installing stack/builder (v1.0.5): Loading from cache
  - Installing ralouphie/getallheaders (3.0.3): Loading from cache
  - Installing pear/pear_exception (v1.0.1): Loading from cache
  - Installing pear/console_getopt (v1.4.3): Loading from cache
  - Installing pear/pear-core-minimal (v1.10.10): Loading from cache
  - Installing pear/archive_tar (1.4.9): Loading from cache
  - Installing masterminds/html5 (2.3.0): Loading from cache
  - Installing laminas/laminas-zendframework-bridge (1.0.4): Loading from cache
  - Installing laminas/laminas-stdlib (3.2.1): Loading from cache
  - Installing laminas/laminas-escaper (2.6.1): Loading from cache
  - Installing laminas/laminas-feed (2.12.2): Loading from cache
  - Installing laminas/laminas-diactoros (1.8.7p2): Loading from cache
  - Installing guzzlehttp/psr7 (1.6.1): Loading from cache
  - Installing guzzlehttp/promises (v1.3.1): Loading from cache
  - Installing guzzlehttp/guzzle (6.5.4): Loading from cache
  - Installing doctrine/lexer (1.0.2): Loading from cache
  - Installing egulias/email-validator (2.1.17): Loading from cache
  - Installing easyrdf/easyrdf (0.9.1): Loading from cache
  - Installing doctrine/inflector (v1.2.0): Loading from cache
  - Installing doctrine/collections (v1.4.0): Loading from cache
  - Installing doctrine/cache (v1.6.2): Loading from cache
  - Installing doctrine/annotations (v1.4.0): Loading from cache
  - Installing doctrine/common (v2.7.3): Loading from cache
  - Installing composer/semver (1.5.1): Loading from cache
  - Installing asm89/stack-cors (1.3.0): Loading from cache
  - Installing drupal/core (8.9.6): Loading from cache
  - Installing drupal/core-recommended (8.9.6)
symfony/translation suggests installing symfony/config
symfony/validator suggests installing psr/cache-implementation (For using the metadata cache.)
symfony/validator suggests installing symfony/config
symfony/validator suggests installing symfony/expression-language (For using the Expression validator)
symfony/validator suggests installing symfony/intl
symfony/validator suggests installing symfony/property-access (For accessing properties within comparison constraints)
symfony/serializer suggests installing psr/cache-implementation (For using the metadata cache.)
symfony/serializer suggests installing symfony/config (For using the XML mapping loader.)
symfony/serializer suggests installing symfony/property-access (For using the ObjectNormalizer.)
symfony/serializer suggests installing symfony/property-info (To deserialize relations.)
symfony/routing suggests installing symfony/config (For using the all-in-one router or any loader)
symfony/routing suggests installing symfony/expression-language (For using expression matching)
paragonie/random_compat suggests installing ext-libsodium (Provides a modern crypto API that can be used to generate random bytes.)
symfony/psr-http-message-bridge suggests installing nyholm/psr7 (For a super lightweight PSR-7/17 implementation)
symfony/http-kernel suggests installing symfony/browser-kit
symfony/http-kernel suggests installing symfony/config
symfony/http-kernel suggests installing symfony/finder
symfony/http-kernel suggests installing symfony/var-dumper
symfony/dependency-injection suggests installing symfony/config
symfony/dependency-injection suggests installing symfony/expression-language (For using expressions in service container configuration)
symfony/dependency-injection suggests installing symfony/finder (For using double-star glob patterns or when GLOB_BRACE portability is required)
symfony/dependency-injection suggests installing symfony/proxy-manager-bridge (Generate service proxies to lazy load them)
symfony/console suggests installing symfony/lock
symfony/class-loader suggests installing symfony/polyfill-apcu (For using ApcClassLoader on HHVM)
pear/archive_tar suggests installing ext-xz (Lzma2 compression support.)
laminas/laminas-feed suggests installing laminas/laminas-cache (Laminas\Cache component, for optionally caching feeds between requests)
laminas/laminas-feed suggests installing laminas/laminas-db (Laminas\Db component, for use with PubSubHubbub)
laminas/laminas-feed suggests installing laminas/laminas-http (Laminas\Http for PubSubHubbub, and optionally for use with Laminas\Feed\Reader)
laminas/laminas-feed suggests installing laminas/laminas-servicemanager (Laminas\ServiceManager component, for easily extending ExtensionManager implementations)
laminas/laminas-feed suggests installing laminas/laminas-validator (Laminas\Validator component, for validating email addresses used in Atom feeds and entries when using the Writer subcomponent)
guzzlehttp/psr7 suggests installing zendframework/zend-httphandlerrunner (Emit PSR-7 responses)
easyrdf/easyrdf suggests installing ml/json-ld (~1.0)
Generating autoload files
23 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
Scaffolding files for drupal/core:
  - Copy [project-root]/.editorconfig from assets/scaffold/files/editorconfig
  - Copy [project-root]/.gitattributes from assets/scaffold/files/gitattributes
  - Copy [web-root]/.csslintrc from assets/scaffold/files/csslintrc
  - Copy [web-root]/.eslintignore from assets/scaffold/files/eslintignore
  - Copy [web-root]/.eslintrc.json from assets/scaffold/files/eslintrc.json
  - Copy [web-root]/.ht.router.php from assets/scaffold/files/ht.router.php
  - Copy [web-root]/.htaccess from assets/scaffold/files/htaccess
  - Copy [web-root]/example.gitignore from assets/scaffold/files/example.gitignore
  - Copy [web-root]/index.php from assets/scaffold/files/index.php
  - Copy [web-root]/INSTALL.txt from assets/scaffold/files/drupal.INSTALL.txt
  - Copy [web-root]/README.txt from assets/scaffold/files/drupal.README.txt
  - Copy [web-root]/robots.txt from assets/scaffold/files/robots.txt
  - Copy [web-root]/update.php from assets/scaffold/files/update.php
  - Copy [web-root]/web.config from assets/scaffold/files/web.config
  - Copy [web-root]/sites/README.txt from assets/scaffold/files/sites.README.txt
  - Copy [web-root]/sites/development.services.yml from assets/scaffold/files/development.services.yml
  - Copy [web-root]/sites/example.settings.local.php from assets/scaffold/files/example.settings.local.php
  - Copy [web-root]/sites/example.sites.php from assets/scaffold/files/example.sites.php
  - Copy [web-root]/sites/default/default.services.yml from assets/scaffold/files/default.services.yml
  - Copy [web-root]/sites/default/default.settings.php from assets/scaffold/files/default.settings.php
  - Copy [web-root]/modules/README.txt from assets/scaffold/files/modules.README.txt
  - Copy [web-root]/profiles/README.txt from assets/scaffold/files/profiles.README.txt
  - Copy [web-root]/themes/README.txt from assets/scaffold/files/themes.README.txt
  * Homepage: https://www.drupal.org/project/drupal
  * Support:
    * docs: https://www.drupal.org/docs/user_guide/en/index.html
    * chat: https://www.drupal.org/node/314178

  Congratulations, you’ve installed the Drupal codebase
  from the drupal/recommended-project template!


Next steps:
  * Install the site: https://www.drupal.org/docs/8/install
  * Read the user guide: https://www.drupal.org/docs/user_guide/en/index.html
  * Get support: https://www.drupal.org/support
  * Get involved with the Drupal community:
      https://www.drupal.org/getting-involved
  * Remove the plugin that prints this message:
      composer remove drupal/core-project-message
  * Homepage: https://www.drupal.org/project/drupal
  * Support:
    * docs: https://www.drupal.org/docs/user_guide/en/index.html
    * chat: https://www.drupal.org/node/314178
docker@cli:/var/www$ cd barb
docker@cli:/var/www/barb$ composer require drupal/admin_toolbar
    Finished: success: 2, skipped: 0, failure: 0, total: 2
Using version ^2.3 for drupal/admin_toolbar
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
  - Installing drupal/admin_toolbar (2.3.0): Loading from cache
Writing lock file
Generating autoload files
23 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
docker@cli:/var/www/barb$ composer require drupal/smtp
    Finished: success: 1, skipped: 0, failure: 0, total: 1
Using version ^1.0@RC for drupal/smtp
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 2 installs, 0 updates, 0 removals
  - Installing phpmailer/phpmailer (v6.1.7): Loading from cache
  - Installing drupal/smtp (1.0.0-rc4): Loading from cache
phpmailer/phpmailer suggests installing league/oauth2-google (Needed for Google XOAUTH2 authentication)
phpmailer/phpmailer suggests installing hayageek/oauth2-yahoo (Needed for Yahoo XOAUTH2 authentication)
phpmailer/phpmailer suggests installing stevenmaguire/oauth2-microsoft (Needed for Microsoft XOAUTH2 authentication)
drupal/smtp suggests installing drupal/mailsystem (Allows using SMTP alongside other mail modules.)
Writing lock file
Generating autoload files
24 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
docker@cli:/var/www/barb$ composer --version
Composer version 1.10.13 2020-09-09 11:46:34
docker@cli:/var/www/barb$
manoloka’s picture

thanks jjmvb but as I said I'm new to this so don't have a clue what all that means :(

I've tried those two modules as I could have tried any other, the point is it won't allow me to install any module from composer getting the same message all the time. Which makes me think I'm doing something wrong. 

Could you please specify a bit?

Thanks

mmjvb’s picture

At least it shows what it should have looked like. Note, due to difficulties with this project template I didn't install the site yet. The first thing to look at is always the version of Composer in use.

The protocol shows what you should see. Just repeat it in your environment and verify what happens. Report what is different, be specific when you do.

manoloka’s picture

ok,  I'll do that and report

Thanks a lot
Manu

fkelly12054@gmail.com’s picture

Look on the module's project page for composer installation syntax.  For instance, admin toolbar would be:

$ composer require 'drupal/admin_toolbar:^2.3'

Not sure where you are installing it. I have found that from a Windows command prompt screen you have to leave the single quotes out in the command, i.e., $ composer require drupal/admin_toolbar:^2.3

Drupal developers are Windows averse (IMHO) and I've found that if you leave those single quotes in the command will just fail without meaningful explanation. Welcome to command line.

manoloka’s picture

I'm working on a shared hosting with  LINUX PHP 7.2.33 MySQL 5.5 from a windows pc through the SSH hosting service web console.

I tried that an got the same answer

Thanks

mmjvb’s picture

Use `composer config repos` and verify there is packages.drupal.org mentioned.

As an alternative you could `composer show drupal/admin_toolbar --all` to see whether the repository for drupal is accessible.

docker@cli:/var/www/barb$ composer show drupal/admin_toolbar --all
name     : drupal/admin_toolbar
descrip. : Provides a drop-down menu interface to the core Drupal Toolbar.
keywords : Drupal, Toolbar
versions : 2.x-dev, * 2.3.0, 2.2.0, 2.1.0, 2.0.0, 2.0.0-beta2, 2.0.0-beta1, 1.x-dev, 1.27.0, 1.26.0, 1.25.0, 1.24.0, 1.23.0, 1.22.0, 1.21.0, 1.20.0, 1.19.0, 1.18.0, 1.17.0, 1.16.0, 1.15.0, 1.14.0, 1.13.0, 1.12.0, 1.11.0, 1.10.0, 1.9.0, 1.8.0, 1.7.0, 1.6.0, 1.5.0, 1.4.0, 1.3.0, 1.2.0, 1.1.0, 1.0.0, dev-2.x, dev-1.x
type     : drupal-module
license  : GNU General Public License v2.0 or later (GPL-2.0-or-later) (OSI approved) https://spdx.org/licenses/GPL-2.0-or-later.html#licenseText
homepage : http://drupal.org/project/admin_toolbar
source   : [git] https://git.drupalcode.org/project/admin_toolbar.git 8.x-2.3
dist     : [zip] https://ftp.drupal.org/files/projects/admin_toolbar-8.x-2.3.zip 8.x-2.3
path     : /var/www/barb/web/modules/contrib/admin_toolbar
names    : drupal/admin_toolbar

support
source : https://git.drupalcode.org/project/admin_toolbar
issues : https://www.drupal.org/project/issues/admin_toolbar

requires
drupal/core ^8.8.0 || ^9.0
docker@cli:/var/www/barb$

Also, composer commands must be executed when in the folder you created: /var/www/barb in my environment. Looks like you executed them from a folder without a composer.json. 

manoloka’s picture

I haven't had time to reinstall and get the full report :(,

I've tried the 

composer show drupal/admin_toolbar --all

command and gives me this answer "[InvalidArgumentException], Package drupal/admin_toolbar not found", which I guess is normal as it hasn't been installed yet, is it?

Also, composer commands must be executed when in the folder you created: /var/www/barb in my environment. Looks like you executed them from a folder without a composer.json. 

Not exactly that, barb is not under www/ but at the same level and the sub.mydomain.com points to barb/web. I did it like that because this tutorial says;

composer create-project drupal/recommended-project my_site_name_dir

Your 'my_site_name_dir' will contain files that should be outside of your web root and not  accessible by the web server. The web root will be 'my_site_name_dir/web'.

However I have the feeling that my problem may have to be something related to where I'm giving the commands (the ssh web hosting IU) and where the drupal installation is ¿?¿?¿?

This is the hosting estructure

  • where barb/ is the folder where the drupal 8 project installed with composer is (sub.mydomain.com points to barb/web)
  • www/ is the default public folder from where I host the main web I have on this server right now

To get composer running I use

php composer.phar

and the this 

alias composer="php composer.phar"

I've tried 

php barb/composer.phar

but I get a "Could not open input file: barb/composer.phar"

I'm on Composer version 1.10.13 2020-09-09 11:46:34

Thanks :)

mmjvb’s picture

composer show drupal/admin_toolbar --all

Should give you similar output as I provided above. No, the error means it can't find such package in the repos you mentioned for your project. 

Your current directory (pwd) needs to be ...../barb when executing the above composer commands. It should contain a composer.json with the repo for drupal 8

How and where composer itself is installed is irrelevant. It either works or not. Consider your current installation of Composer in the wrong place. Obviously, php needs to see composer.phar. The location of composer.phar must be in your PATH for php to find it, as it won't be in the current directory.

 

manoloka’s picture

Ok, lets start from 0 ... I've created a new project using

composer create-project drupal/recommended-project:8.9.6 d8cbarbt

I got this report

progatbarbera@hl338:~$ composer create-project drupal/recommended-project:8.9.6 d8cbarbt
Creating a "drupal/recommended-project:8.9.6" project at "./d8cbarbt"
Installing drupal/recommended-project (8.9.6)
  - Installing drupal/recommended-project (8.9.6): Loading from cache
Created project in /usr/home/progatbarbera/d8cbarbt
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Package operations: 59 installs, 0 updates, 0 removals
  - Installing composer/installers (v1.9.0): Loading from cache
  - Installing drupal/core-composer-scaffold (8.9.6): Loading from cache
  - Installing drupal/core-project-message (8.9.6): Loading from cache
  - Installing typo3/phar-stream-wrapper (v3.1.4): Loading from cache
  - Installing symfony/polyfill-ctype (v1.17.0): Loading from cache
  - Installing twig/twig (v1.42.5): Loading from cache
  - Installing symfony/yaml (v3.4.41): Loading from cache
  - Installing symfony/polyfill-mbstring (v1.17.0): Loading from cache
  - Installing symfony/translation (v3.4.41): Loading from cache
  - Installing symfony/validator (v3.4.41): Loading from cache
  - Installing symfony/serializer (v3.4.41): Loading from cache
  - Installing symfony/routing (v3.4.41): Loading from cache
  - Installing paragonie/random_compat (v9.99.99): Loading from cache
  - Installing symfony/polyfill-php70 (v1.17.0): Loading from cache
  - Installing symfony/http-foundation (v3.4.41): Loading from cache
  - Installing psr/http-message (1.0.1): Loading from cache
  - Installing symfony/psr-http-message-bridge (v1.1.2): Loading from cache
  - Installing symfony/process (v3.4.41): Loading from cache
  - Installing symfony/polyfill-util (v1.17.0): Loading from cache
  - Installing symfony/polyfill-php72 (v1.17.0): Loading from cache
  - Installing symfony/polyfill-php56 (v1.17.0): Loading from cache
  - Installing symfony/polyfill-intl-idn (v1.17.0): Loading from cache
  - Installing symfony/polyfill-iconv (v1.17.0): Loading from cache
  - Installing symfony/event-dispatcher (v3.4.41): Loading from cache
  - Installing psr/log (1.1.3): Loading from cache
  - Installing symfony/debug (v3.4.41): Loading from cache
  - Installing symfony/http-kernel (v3.4.44): Loading from cache
  - Installing psr/container (1.0.0): Loading from cache
  - Installing symfony/dependency-injection (v3.4.41): Loading from cache
  - Installing symfony/console (v3.4.41): Loading from cache
  - Installing symfony/class-loader (v3.4.41): Loading from cache
  - Installing symfony-cmf/routing (1.4.1): Loading from cache
  - Installing stack/builder (v1.0.5): Loading from cache
  - Installing ralouphie/getallheaders (3.0.3): Loading from cache
  - Installing pear/pear_exception (v1.0.1): Loading from cache
  - Installing pear/console_getopt (v1.4.3): Loading from cache
  - Installing pear/pear-core-minimal (v1.10.10): Loading from cache
  - Installing pear/archive_tar (1.4.9): Loading from cache
  - Installing masterminds/html5 (2.3.0): Loading from cache
  - Installing laminas/laminas-zendframework-bridge (1.0.4): Loading from cache
  - Installing laminas/laminas-stdlib (3.2.1): Loading from cache
  - Installing laminas/laminas-escaper (2.6.1): Loading from cache
  - Installing laminas/laminas-feed (2.12.2): Loading from cache
  - Installing laminas/laminas-diactoros (1.8.7p2): Loading from cache
  - Installing guzzlehttp/psr7 (1.6.1): Loading from cache
  - Installing guzzlehttp/promises (v1.3.1): Loading from cache
  - Installing guzzlehttp/guzzle (6.5.4): Loading from cache
  - Installing doctrine/lexer (1.0.2): Loading from cache
  - Installing egulias/email-validator (2.1.17): Loading from cache
  - Installing easyrdf/easyrdf (0.9.1): Loading from cache
  - Installing doctrine/inflector (v1.2.0): Loading from cache
  - Installing doctrine/collections (v1.4.0): Loading from cache
  - Installing doctrine/cache (v1.6.2): Loading from cache
  - Installing doctrine/annotations (v1.4.0): Loading from cache
  - Installing doctrine/common (v2.7.3): Loading from cache
  - Installing composer/semver (1.5.1): Loading from cache
  - Installing asm89/stack-cors (1.3.0): Loading from cache
  - Installing drupal/core (8.9.6): Loading from cache
  - Installing drupal/core-recommended (8.9.6)
symfony/translation suggests installing symfony/config
symfony/validator suggests installing psr/cache-implementation (For using the metadata cache.)
symfony/validator suggests installing symfony/config
symfony/validator suggests installing symfony/expression-language (For using the Expression validator)
symfony/validator suggests installing symfony/intl
symfony/validator suggests installing symfony/property-access (For accessing properties within comparison constraints)
symfony/serializer suggests installing psr/cache-implementation (For using the metadata cache.)
symfony/serializer suggests installing symfony/config (For using the XML mapping loader.)
symfony/serializer suggests installing symfony/property-access (For using the ObjectNormalizer.)
symfony/serializer suggests installing symfony/property-info (To deserialize relations.)
symfony/routing suggests installing symfony/config (For using the all-in-one router or any loader)
symfony/routing suggests installing symfony/expression-language (For using expression matching)
symfony/psr-http-message-bridge suggests installing nyholm/psr7 (For a super lightweight PSR-7/17 implementation)
symfony/http-kernel suggests installing symfony/browser-kit
symfony/http-kernel suggests installing symfony/config
symfony/http-kernel suggests installing symfony/finder
symfony/http-kernel suggests installing symfony/var-dumper
symfony/dependency-injection suggests installing symfony/config
symfony/dependency-injection suggests installing symfony/expression-language (For using expressions in service container configuration)
symfony/dependency-injection suggests installing symfony/finder (For using double-star glob patterns or when GLOB_BRACE portability is required)
symfony/dependency-injection suggests installing symfony/proxy-manager-bridge (Generate service proxies to lazy load them)
symfony/console suggests installing symfony/lock
symfony/class-loader suggests installing symfony/polyfill-apcu (For using ApcClassLoader on HHVM)
pear/archive_tar suggests installing ext-xz (Lzma2 compression support.)
laminas/laminas-feed suggests installing laminas/laminas-cache (Laminas\Cache component, for optionally caching feeds between requests)
laminas/laminas-feed suggests installing laminas/laminas-db (Laminas\Db component, for use with PubSubHubbub)
laminas/laminas-feed suggests installing laminas/laminas-http (Laminas\Http for PubSubHubbub, and optionally for use with Laminas\Feed\Reader)
laminas/laminas-feed suggests installing laminas/laminas-servicemanager (Laminas\ServiceManager component, for easily extending ExtensionManager implementations)
laminas/laminas-feed suggests installing laminas/laminas-validator (Laminas\Validator component, for validating email addresses used in Atom feeds and entries when using the Writer subcomponent)
guzzlehttp/psr7 suggests installing zendframework/zend-httphandlerrunner (Emit PSR-7 responses)
easyrdf/easyrdf suggests installing ml/json-ld (~1.0)
Generating autoload files
23 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
Scaffolding files for drupal/core:
  - Copy [project-root]/.editorconfig from assets/scaffold/files/editorconfig
  - Copy [project-root]/.gitattributes from assets/scaffold/files/gitattributes
  - Copy [web-root]/.csslintrc from assets/scaffold/files/csslintrc
  - Copy [web-root]/.eslintignore from assets/scaffold/files/eslintignore
  - Copy [web-root]/.eslintrc.json from assets/scaffold/files/eslintrc.json
  - Copy [web-root]/.ht.router.php from assets/scaffold/files/ht.router.php
  - Copy [web-root]/.htaccess from assets/scaffold/files/htaccess
  - Copy [web-root]/example.gitignore from assets/scaffold/files/example.gitignore
  - Copy [web-root]/index.php from assets/scaffold/files/index.php
  - Copy [web-root]/INSTALL.txt from assets/scaffold/files/drupal.INSTALL.txt
  - Copy [web-root]/README.txt from assets/scaffold/files/drupal.README.txt
  - Copy [web-root]/robots.txt from assets/scaffold/files/robots.txt
  - Copy [web-root]/update.php from assets/scaffold/files/update.php
  - Copy [web-root]/web.config from assets/scaffold/files/web.config
  - Copy [web-root]/sites/README.txt from assets/scaffold/files/sites.README.txt
  - Copy [web-root]/sites/development.services.yml from assets/scaffold/files/development.services.yml
  - Copy [web-root]/sites/example.settings.local.php from assets/scaffold/files/example.settings.local.php
  - Copy [web-root]/sites/example.sites.php from assets/scaffold/files/example.sites.php
  - Copy [web-root]/sites/default/default.services.yml from assets/scaffold/files/default.services.yml
  - Copy [web-root]/sites/default/default.settings.php from assets/scaffold/files/default.settings.php
  - Copy [web-root]/modules/README.txt from assets/scaffold/files/modules.README.txt
  - Copy [web-root]/profiles/README.txt from assets/scaffold/files/profiles.README.txt
  - Copy [web-root]/themes/README.txt from assets/scaffold/files/themes.README.txt
  * Homepage: https://www.drupal.org/project/drupal
  * Support:
    * docs: https://www.drupal.org/docs/user_guide/en/index.html
    * chat: https://www.drupal.org/node/314178

  Congratulations, you’ve installed the Drupal codebase
  from the drupal/recommended-project template!
Next steps:
  * Install the site: https://www.drupal.org/docs/8/install
  * Read the user guide: https://www.drupal.org/docs/user_guide/en/index.html
  * Get support: https://www.drupal.org/support
  * Get involved with the Drupal community:
      https://www.drupal.org/getting-involved
  * Remove the plugin that prints this message:
      composer remove drupal/core-project-message
  * Homepage: https://www.drupal.org/project/drupal
  * Support:
    * docs: https://www.drupal.org/docs/user_guide/en/index.html
    * chat: https://www.drupal.org/node/314178
progatbarbera@hl338:~$

My sub.mysite.org points to user/d8cbarbt/web

I run the installer from my d8cbarbt.mysite.org and have a brand new d8 working fine with a  "All fine 27 CHECKED details" at the status reports.

Right after I try to install Admin toolbar (or other modules for the matter) with the recommended command at the projects pages and I get;

progatbarbera@hl338:~$ composer require drupal/admin_toolbar
  [InvalidArgumentException]
  Could not find a matching version of package drupal/admin_toolbar. Check the package spelling, your version constraint and that the package is availab
  le in a stability which matches your minimum-stability (stable).
require [--dev] [--prefer-source] [--prefer-dist] [--fixed] [--no-progress] [--no-suggest] [--no-update] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--update-with-all-dependencies] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--] [<packages>]...
progatbarbera@hl338:~$
progatbarbera@hl338:~$ composer require drupal/adminimal_theme
  [InvalidArgumentException]
  Could not find a matching version of package drupal/adminimal_theme. Check the package spelling, your version constraint and that the package is avail
  able in a stability which matches your minimum-stability (stable).
require [--dev] [--prefer-source] [--prefer-dist] [--fixed] [--no-progress] [--no-suggest] [--no-update] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--update-with-all-dependencies] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--] [<packages>]...
progatbarbera@hl338:~$ 

I don't know if this is of any value ... W the command I use to get composer runing is 

php composer.phar
alias composer="php composer.phar"

Thanks :)
manu

manoloka’s picture

I forgot, I can install and enable both Adminimal theme and Admin Toolbar module from URL from the web IU and get them up and running without a problem

mmjvb’s picture

As mentioned several times and you concluded that yourself: ran from the wrong location!

You need to be in d8cbarbt when running the `composer require` commands!

manoloka’s picture

ok,

the command I use to get composer running is, 

php composer.phar

and then

alias composer="php composer.phar"

so, how do I run it from d8cbarbt ? 

if I try with php d8cbarbt/composer.phar

progatbarbera@hl338:~$ php d8cbarbt/composer.phar
Could not open input file: d8cbarbt/composer.phar
progatbarbera@hl338:~$

I'm completely new to command line :(

progatbarbera@hl338:~$ cd d8cbarbt
progatbarbera@hl338:~/d8cbarbt$ composer require drupal/admin_toolbar
-bash: composer: command not found
progatbarbera@hl338:~/d8cbarbt$
progatbarbera@hl338:~$ php d8cbarbt/composer.phar
Could not open input file: d8cbarbt/composer.phar
progatbarbera@hl338:~$ php progatbarbera/d8cbarbt/composer.phar
Could not open input file: progatbarbera/d8cbarbt/composer.phar
progatbarbera@hl338:~$ php home/progatbarbera/d8cbarbt/composer.phar
Could not open input file: home/progatbarbera/d8cbarbt/composer.phar
progatbarbera@hl338:~$ php usr/home/progatbarbera/d8cbarbtcomposer.phar
Could not open input file: usr/home/progatbarbera/d8cbarbtcomposer.phar
progatbarbera@hl338:~$
mmjvb’s picture

anywhere:-$ composer create-project drupal/recommended-project /folder/for/my/project
anywhere:-$ cd /folder/for/my/project
/folder/for/my/project:-$ composer require drupal/admin_toolbar
manoloka’s picture

I get this

progatbarbera@hl338:~$ cd d8cbarbt
progatbarbera@hl338:~/d8cbarbt$ composer require drupal/admin_toolbar
Could not open input file: composer.phar
progatbarbera@hl338:~/d8cbarbt$

I'm thinking why it says "Could not open input file: composer.phar"? ...  but actually composer is not installed in that folder but one level higher, so it's no surprise it cant find it.

So, after D8 installation , do I need to move/reinstall composer inside my d8cbarbt? ... I mean before doing the d8 install, composer was installed in my user root (I believe), do I have to "somehow" move composer to /folder/for/my/project or install it again there?

Or, could this be a problem of permissions with user within my hosting?

I must be stupid, I bet is something very easy :(  ;)

mmjvb’s picture

That is done by adding the folder to your PATH

manoloka’s picture

Finally I manage to install smtp with composer

but I had to use

php composer.phar require drupal/smtp

instead of 

composer require drupal/smtp

which I guess is the standard as is what all modules give as a command "composer require drupal/module"

progatbarbera@hl338:~/d8cbarbt$ composer require drupal/smtp
-bash: composer: command not found
progatbarbera@hl338:~/d8cbarbt$ php composer.phar require drupal/smtp
Using version ^1.0@RC for drupal/smtp
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 2 installs, 0 updates, 0 removals
  - Installing phpmailer/phpmailer (v6.1.7): Downloading (100%)
  - Installing drupal/smtp (1.0.0-rc4): Downloading (100%)
phpmailer/phpmailer suggests installing league/oauth2-google (Needed for Google XOAUTH2 authentication)
phpmailer/phpmailer suggests installing hayageek/oauth2-yahoo (Needed for Yahoo XOAUTH2 authentication)
phpmailer/phpmailer suggests installing stevenmaguire/oauth2-microsoft (Needed for Microsoft XOAUTH2 authentication)
drupal/smtp suggests installing drupal/mailsystem (Allows using SMTP alongside other mail modules.)
Writing lock file
Generating autoload files
24 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
progatbarbera@hl338:~/d8cbarbt$

Luckly it's working which is whats important, however why my server forces my to use "php composer.phar require drupal/smtp" instead or "composer require drupal/smtp"? I guess must be some setting withing the server that I may or not (as I'm in a shared hosting) 

manoloka’s picture

However ... now that I manage to start installing modules (so far only 1) I try to install module filter and I get another error
"Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 67108864 bytes) in" 
also tried with a couple of modules and got the same

php composer.phar require drupal/module_filter
php composer.phar require drupal/filter_perms

This is obviously a memory limit that must be increased, I'll check with the hosting service.

/d8cbarbt$ php composer.phar require drupal/module_filter
Using version ^3.1 for drupal/module_filter
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
PHP Fatal error:  Allowed memory size of 1610612736 bytes exhausted (tried to allocate 67108864 bytes) in phar:///usr/home/progatbarbera/d8cbarbt/composer.phar/src/Composer/DependencyResolver/Solver.php on line 223

Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 67108864 bytes) in phar:///usr/home/progatbarbera/d8cbarbt/composer.phar/src/Composer/DependencyResolver/Solver.php on line 223

Check https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors for more info on how to handle out of memory errors.progatbarbera@hl338:~/d8cbarbt$
mmjvb’s picture

or export COMPOSER_MEMORY_LIMIT=-1; 

in your shell.

manoloka’s picture

using 

 export COMPOSER_MEMORY_LIMIT=-1; 

I got it done :)

/d8cbarbt$ export COMPOSER_MEMORY_LIMIT=-1;
progatbarbera@hl338:~/d8cbarbt$ php composer.phar require drupal/filter_perms
Using version ^1.0@alpha for drupal/filter_perms
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 2 installs, 0 updates, 0 removals
  - Installing drupal/filter_perms (1.0.0-alpha1): Downloading (100%)
  - Installing drupal/module_filter (3.1.0): Downloading (100%)
Writing lock file
Generating autoload files
24 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
progatbarbera@hl338:~/d8cbarbt$

Thank you very much for all your help mmjvb

I couldn't have done it without you :)

mmjvb’s picture

Glad to see you managed to get it work. Working on the command line can be intimidating. Suggest to score some youtube intro's on working on the command line. Your issues were related to not having a basic understanding of working on the command line.

manoloka’s picture

yep, I'm looking for some tutorials for newbies before I get something more complicated, I'd like start using git and drush too for my projects.
Thanks