PHP warning with composer on MacOS Mojave: Failed to open stream: No such file or directory I am working on a plugin in Craft:3.4. I get this error while trying to install the plugin in the CP.
yii\base\ErrorException: include(/app/vendor/composer/../wittsstratts/craft-company/src/Company.php): failed to open stream: No such file or directory in /app/vendor/composer/ClassLoader.php:444
Stack trace:
#0 /app/vendor/craftcms/cms/src/web/ErrorHandler.php(74): yii\base\ErrorHandler-&gt;handleError(2, 'include(/app/ve...', '/app/vendor/com...', 444)
#1 /app/vendor/composer/ClassLoader.php(444): craft\web\ErrorHandler-&gt;handleError(2, 'include(/app/ve...', '/app/vendor/com...', 444, Array)
#2 /app/vendor/composer/ClassLoader.php(444): include()
#3 /app/vendor/composer/ClassLoader.php(322): Composer\Autoload\includeFile('/app/vendor/com...')
#4 [internal function]: Composer\Autoload\ClassLoader-&gt;loadClass('wittsstratts\\co...')
#5 [internal function]: spl_autoload_call('wittsstratts\\co...')
#6 /app/vendor/craftcms/cms/src/services/Plugins.php(873): is_subclass_of('wittsstratts\\co...', 'craft\\base\\Plug...')
#7 /app/vendor/craftcms/cms/src/services/Plugins.php(478): craft\services\Plugins-&gt;createPlugin('company')
#8 /app/vendor/craftcms/cms/src/controllers/PluginsController.php(50): craft\services\Plugins-&gt;installPlugin('company', NULL)
#9 [internal function]: craft\controllers\PluginsController-&gt;actionInstallPlugin()
#10 /app/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#11 /app/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction-&gt;runWithParams(Array)
#12 /app/vendor/craftcms/cms/src/web/Controller.php(178): yii\base\Controller-&gt;runAction('install-plugin', Array)
#13 /app/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller-&gt;runAction('install-plugin', Array)
#14 /app/vendor/craftcms/cms/src/web/Application.php(290): yii\base\Module-&gt;runAction('plugins/install...', Array)
#15 /app/vendor/craftcms/cms/src/web/Application.php(558): craft\web\Application-&gt;runAction('plugins/install...', Array)
#16 /app/vendor/craftcms/cms/src/web/Application.php(269): craft\web\Application-&gt;_processActionRequest(Object(craft\web\Request))
#17 /app/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application-&gt;handleRequest(Object(craft\web\Request))
#18 /app/web/index.php(21): yii\base\Application-&gt;run()
#19 {main}


This question is related to this but with a different setup.
Tools:

Docker:19.03.5
Composer:1.10-dev

This might help anyone facing this same issue.
I found the reason for the error was because I was using docker. Composer symlinks the plugin from its physical directory into craft's vendor directory. The plugin directory as a result of this was not mounted into docker container. Thus, craft was not able to locate the plugin directory. All I did to fix this was move the project(plugin) into craft's vendor director.
Composer symlinked the plugin from its physical directory into craft's vendor directory. The plugin directory as a result of this was not mounted into the docker container. Thus, craft was not able to locate the plugin as it wasn't mounted into my docker container. All I did to fix this was move the project(plugin) into craft's vendor director.