3

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

Steve B
  • 257
  • 4
  • 13

5 Answers5

9

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!

Steve B
  • 257
  • 4
  • 13
2

I believe you can run npm install --no-optional buble which should prevent optional dependencies from being installed. Before you do this you should delete the old node_modules and start fresh.

https://docs.npmjs.com/cli/install

  • 1
    Thanks for the suggestion and the link. I deleted my node_modules directory and attempted your command, but I get the same error. How do I know this buble package is "optional"? Following your link, I also tried `npm intall --no-json-lock`, but that unleashed a whole bunch of errors. – Steve B Nov 20 '17 at 20:40
2

delete package-lock.json and do npm install again

g.sui
  • 1,550
  • 3
  • 15
  • 20
1

My problem was that I did not GIT github installed on my machine. You need to install Git, so the npm install can use it to download packages

Bartando
  • 719
  • 8
  • 26
0

I have similar problem but not quite same. I had this issue when I try to npm install inside my company network environment. Some certain SSH and HTTPS is blocked. The error message is

npm sill pacote Retrying git command: ls-remote -h -t https://github.com/pemrouz/buble.git attempt # 6
npm sill pacote Retrying git command: ls-remote -h -t https://github.com/pemrouz/buble.git attempt # 7

I removed package-lock.json and do npm install again. Everything was fine.

heinels
  • 189
  • 1
  • 6