<p>I had the same issue, and was able to get composer working again by deleting the <code>vendor/composer/installed.json</code> file. The file was re-created (and each package’s source refererence field re-populated) when I ran <code>composer update</code>.</p>

CC BY-SA 4.0
2018-05-16T14:33:24.040Z
2018-05-16T14:33:24.040Z
Myers
<p>All of the references in the source key were missing from my old installed.json file.</p>

<p>I'm not entirely sure what caused the issue but I corrected by installing a new instance of Craft and copying the installed.json into the version of the file that was causing problems.</p>

<p>I am now able to run composer commands again.</p>

CC BY-SA 4.0
2018-05-03T02:29:03.077Z
2018-05-03T02:29:03.077Z
Kevin
<p>I'm having trouble making updates using composer on a new CraftCMS 3 install. This was working at one point as I was able to require a local repository for plugin development purposes.</p>

<p>Any composer usage ("composer info", "composer update", "composer list", etc.) yields the following:</p>

<pre><code>[UnexpectedValueException]                                                                             
Package cebe/markdown's source key should be specified as {"type": ..., "url": ..., "reference": ...}, {"type":"git","url":"https:\/\/github.com\/cebe\/markdown.git","reference":null} given. 
</code></pre>

<p>My (abbreviated) installed.json is as follows:</p>

<pre><code>[
{
    "name": "cebe/markdown",
    "version": "1.1.2",
    "version_normalized": "1.1.2.0",
    "source": {
        "type": "git",
        "url": "https://github.com/cebe/markdown.git",
        "reference": null
    },
    "dist": {
        "type": "zip",
        "url": "https://api.github.com/repos/cebe/markdown/zipball/",
        "reference": null,
        "shasum": ""
    },
    "require": {
        "lib-pcre": "*",
        "php": "&gt;=5.4.0"
    },
    "require-dev": {
        "cebe/indent": "*",
        "facebook/xhprof": "*@dev",
        "phpunit/phpunit": "4.1.*"
    },
    "time": "2017-07-16 21:13:23",
    "bin": [
        "bin/markdown"
    ],
    "type": "library",
    "extra": {
        "branch-alias": {
            "dev-master": "1.1.x-dev"
        }
    },
    "installation-source": "dist",
    "autoload": {
        "psr-4": {
            "cebe\\markdown\\": ""
        }
    },
    "notification-url": "https://packagist.org/downloads/",
    "license": [
        "MIT"
    ],
    "authors": [
        {
            "name": "Carsten Brandt",
            "email": "mail@cebe.cc",
            "homepage": "http://cebe.cc/",
            "role": "Creator"
        }
    ],
    "description": "A super fast, highly extensible markdown parser for PHP",
    "homepage": "https://github.com/cebe/markdown#readme",
    "keywords": [
        "extensible",
        "fast",
        "gfm",
        "markdown",
        "markdown-extra"
    ]
}
</code></pre>

<p>]</p>

<p>I've been staring at this all afternoon and could use a fresh set of eyes. Anyone have any ideas?</p>

<p>Thanks in advance.</p>

<composer>
Can't use composer with CraftCMS 3
# Can't use composer with CraftCMS 3

(Asked by: username_0 on 2018-05-02)

I'm having trouble making updates using composer on a new CraftCMS 3 install. This was working at one point as I was able to require a local repository for plugin development purposes.
Any composer usage ("composer info", "composer update", "composer list", etc.) yields the following:
[UnexpectedValueException]                                                                             
Package cebe/markdown's source key should be specified as {"type": ..., "url": ..., "reference": ...}, {"type":"git","url":"https:\/\/github.com\/cebe\/markdown.git","reference":null} given. 

My (abbreviated) installed.json is as follows:
[
{
    "name": "cebe/markdown",
    "version": "1.1.2",
    "version_normalized": "1.1.2.0",
    "source": {
        "type": "git",
        "url": "https://github.com/cebe/markdown.git",
        "reference": null
    },
    "dist": {
        "type": "zip",
        "url": "https://api.github.com/repos/cebe/markdown/zipball/",
        "reference": null,
        "shasum": ""
    },
    "require": {
        "lib-pcre": "*",
        "php": ">=5.4.0"
    },
    "require-dev": {
        "cebe/indent": "*",
        "facebook/xhprof": "*@dev",
        "phpunit/phpunit": "4.1.*"
    },
    "time": "2017-07-16 21:13:23",
    "bin": [
        "bin/markdown"
    ],
    "type": "library",
    "extra": {
        "branch-alias": {
            "dev-master": "1.1.x-dev"
        }
    },
    "installation-source": "dist",
    "autoload": {
        "psr-4": {
            "cebe\\markdown\\": ""
        }
    },
    "notification-url": "https://packagist.org/downloads/",
    "license": [
        "MIT"
    ],
    "authors": [
        {
            "name": "Carsten Brandt",
            "email": "mail@cebe.cc",
            "homepage": "http://cebe.cc/",
            "role": "Creator"
        }
    ],
    "description": "A super fast, highly extensible markdown parser for PHP",
    "homepage": "https://github.com/cebe/markdown#readme",
    "keywords": [
        "extensible",
        "fast",
        "gfm",
        "markdown",
        "markdown-extra"
    ]
}

]
I've been staring at this all afternoon and could use a fresh set of eyes. Anyone have any ideas?
Thanks in advance.

**Tags:** composer


---

## 2 answers

### Answer by username_1 on 2018-05-16. Score: 1

I had the same issue, and was able to get composer working again by deleting the `vendor/composer/installed.json` file. The file was re-created (and each package’s source refererence field re-populated) when I ran `composer update`.


---

### Answer by username_0 on 2018-05-03. Score: 1

All of the references in the source key were missing from my old installed.json file.

I'm not entirely sure what caused the issue but I corrected by installing a new instance of Craft and copying the installed.json into the version of the file that was causing problems.

I am now able to run composer commands again.


---

