为什么Composer没有使用我的composer.json文件中的要求更新我的/ vendor文件夹?

My composer.json file is pretty simple, just requiring Twig and a PHP version number like so:

{
  "name": "name-here",
  "type": "wordpress-plugin",
  "require": {
    "twig/twig": "^2.0"
  },
  "autoload":{
    "psr-4": {
      "namespace-name-here\\" : "./"
    }
  }
}

Yet when I run composer dump-autoload it only creates the /vendor/composer directory. In my other projects, the /twig and /symfony directories are creating from my composer.json file. So I have to copy the two missing directories into my project to work.

What am I missing here? I delete the entire /vendor directory and re-run the composer dump-autoload command and still the same result.

You need to use composer install.