Skip to content

Add magento 2 module in ubuntu error

Repositories code generation… 1/9 [===>————————] 11% < 1 sec 117.0 MiBsyntax error, unexpected token “&”, expecting “function” or “const”#0 /var/www/myshop/vendor/composer/ClassLoader.php(433): ComposerAutoload{closure}()
#1 [internal function]: ComposerAutoloadClassLoader->loadClass()
#2 /var/www/myshop/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php(134): class_exists()
#3 /var/www/myshop/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php(117): MagentoSetupModuleDiCodeReaderClassesScanner->includeClass()
#4 /var/www/myshop/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php(87): MagentoSetupModuleDiCodeReaderClassesScanner->extract()
#5 /var/www/myshop/setup/src/Magento/Setup/Module/Di/App/Task/Operation/RepositoryGenerator.php(61): MagentoSetupModuleDiCodeReaderClassesScanner->getList()
#6 /var/www/myshop/setup/src/Magento/Setup/Module/Di/App/Task/Manager.php(56): MagentoSetupModuleDiAppTaskOperationRepositoryGenerator->doOperation()
#7 /var/www/myshop/setup/src/Magento/Setup/Console/Command/DiCompileCommand.php(216): MagentoSetupModuleDiAppTaskManager->process()
#8 /var/www/myshop/vendor/symfony/console/Command/Command.php(255): MagentoSetupConsoleCommandDiCompileCommand->execute()
#9 /var/www/myshop/vendor/symfony/console/Application.php(1021): SymfonyComponentConsoleCommandCommand->run()
#10 /var/www/myshop/vendor/symfony/console/Application.php(275): SymfonyComponentConsoleApplication->doRunCommand()
#11 /var/www/myshop/vendor/magento/framework/Console/Cli.php(115): SymfonyComponentConsoleApplication->doRun()
#12 /var/www/myshop/vendor/symfony/console/Application.php(149): MagentoFrameworkConsoleCli->doRun()
#13 /var/www/myshop/bin/magento(23): SymfonyComponentConsoleApplication->run()
#14 {main}