Search code examples
npmpackage-lock.json

npm install fails: buble@github:pemrouz/buble reference is not a tree


Summary:

I am looking for a strategy on how I might find and fix an error in package-lock.json. This error breaks npm install:

  • How do I figure out what installed this buble dependency?
  • Can I simply delete the entry?
  • How do I figure out what the reference value should be?

Details

I wanted to update my node_modules. So I deleted my node_modules directory, and ran npm install. While this has always worked in the past, it is now failing with the following error (found in the AppData\Roaming\npm-cache_logs\XXXX-debug.log):

13 silly fetchPackageMetaData error for buble@github:pemrouz/buble#fdcd2bac2c8945816b6fe3b032e49b58cc728b14 Command failed: C:\Program Files\Git\mingw64\bin\git.EXE checkout fdcd2bac2c8945816b6fe3b032e49b58cc728b14
13 silly fetchPackageMetaData fatal: reference is not a tree: fdcd2bac2c8945816b6fe3b032e49b58cc728b14
14 verbose stack Error: Command failed: C:\Program Files\Git\mingw64\bin\git.EXE checkout fdcd2bac2c8945816b6fe3b032e49b58cc728b14
14 verbose stack fatal: reference is not a tree: fdcd2bac2c8945816b6fe3b032e49b58cc728b14
14 verbose stack
14 verbose stack     at ChildProcess.exithandler (child_process.js:271:12)
14 verbose stack     at emitTwo (events.js:125:13)
14 verbose stack     at ChildProcess.emit (events.js:213:7)
14 verbose stack     at maybeClose (internal/child_process.js:927:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)

I believe the reference is from /package-lock.json where I find 2 entries using this reference. Searching the Net has taught me that /package-lock.json is updated by npm. I do not know how this bubble package got added to my project - must be a dependency of some other package, but I lack the skills to figure out which. The entries look like the following:

...
"buble": {
      "version": "github:pemrouz/buble#fdcd2bac2c8945816b6fe3b032e49b58cc728b14",
      "requires": {
        "acorn": "5.2.1",
...

Searching the Net for similar issues seem to be from users who are trying to sync up their repositories. Those solutions suggest ways to sync forks in Gitub which does not apply to my case. Near as I can tell, someone has updated the Github repository in some way which breaks this reference.

So, I am looking for a strategy on how I might fix this. How do I figure out what installed this buble dependency? Can I simply delete the entry? How do I figure out what the reference value should be?

Thanks in advance for any direction


Solution

  • I got this working. What I did was delete all references to buble in my package-lock.json file (after having made a back-up copy of course). I then deleted my node_modules directory, did npm cache clear --force, then npm install. npm was able to reload everything, and seems to have re-added the buble package to my package-lock.json now with a new reference value.

    I do not know if all these steps were necessary; in the end I was getting desperate and ready to try everything. Hope this helps someone else!