Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
glob.hasMagic is not a function #637
protobuf.js version: <6.4.5>
After updating/upgrading to 6.4.5 this issue keeps re-surfacing. I am solving by running npm install from my node_modules/protobufjs directory
<please provide a code snippet for reproduction>
I removed protobufjs and then re-installed
npm remove protobufjs
npm install // letting my package.json do the work
Consolidates imports and converts between file formats.
-t, --target Specifies the target format. Also accepts a path to require a custom target.
Hmm, it should really install more than just "tmp".
Without looking too deep at the code, I wonder if it doesn't load because in some other package I have loaded, glob is loaded, and your check sees that and doesn't load it itself.
For Example, (ignore the glob under protobufjs because this is there because I ran npm install within protobufjs), I have glob at the root node_modules level, but pbjs doesn't see it unless it lies within the protobufjs's node_modules??
$ find node_modules/ -type d -name glob -print
Further evidence for my last statement
$ find node_modules/ -maxdepth 2 -type d ( -name glob -or -name chalk -o -name
The only package missing at depth 2 is 'tmp' package.
:) Hope that helps.
That'd imply that
If this assumption isn't correct, this could be happening because
But that's again a long-shot.
Last but not least
Need to test.
added a commit
Jan 12, 2017
I now added semver to CLI dependencies. This one is installed without a version check, but everything else is semver-checked now. Give it a shot!
If it now uses an outdated semver that does not support carets (^) or something, it'd still be possible to install semver first if not at least a major version of 5 is present, and then do the rest.
Output from pbjs
and it ran just fine.