karma-runner / karma-browserstack-launcher

A Karma plugin. Launch any browser on BrowserStack!
MIT License
150 stars 84 forks source link

internalBinding is not defined with version 1.3.0 #140

Open nsthorat opened 5 years ago

nsthorat commented 5 years ago

I'm seeing the following error in a travis build with version 1.3.0, any thoughts on what's going on?

12 12 2018 15:41:47.243:ERROR [plugin]: Error during loading "/home/travis/build/tensorflow/tfjs-core/node_modules/karma-browserstack-launcher" plugin:
  internalBinding is not defined
12 12 2018 15:41:47.468:ERROR [reporter]: Can not load reporter "BrowserStack", it is not registered!
  Perhaps you are missing some plugin?
daiste commented 5 years ago

I have the same problem today. 1.2.0 is working fine

tpluscode commented 5 years ago

Hm, I just got the same problem, also with version 1.3. The only occurrence of internalBinding I found in natives package. And just have a look at the latest commit:

Compatibility fix for internalBinding

I tried updating natives to 1.1.6 but that did not help

tpluscode commented 5 years ago

Hm, and launcher 1.2 did not work for me...

nsthorat commented 5 years ago

FYI this error doesn’t show up in Node 8 so we switched testing to that environment. This is a problem with Node 10 (and natives 1.1.6 didn’t fix it for me either).

lddubeau commented 5 years ago

I upgraded to natives 1.1.6 and the problem went away. npm makes it easy to not successfully upgrade a package, if your own package is not directly dependent on it. So I'll detail what I did.

Prior to the upgrade, my test suite fails like the description given in this issue, and I'm running natives 1.1.4:

$ npm ls natives
salve@9.0.1 [...]/salve
└─┬ karma-browserstack-launcher@1.3.0
  └─┬ browserstacktunnel-wrapper@2.0.3
    └─┬ unzip@0.1.11
      └─┬ fstream@0.1.31
        └─┬ graceful-fs@3.0.11
          └── natives@1.1.4

As shown above, the dependency is deep in the tree of packages, so I'm using --depth=10 to get npm upgrade (aka npm up) to go into the tree. I did not count the depth precisely, I just rounded up to 10. Using a --depth argument with a large enough value is necessary, otherwise npm up won't fix it. So:

$ npm up natives --depth=10
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

+ natives@1.1.6

The last line shows that natives was updated.

Let's check with npm ls:

$ npm ls natives
salve@9.0.1 [...]/salve
└─┬ karma-browserstack-launcher@1.3.0
  └─┬ browserstacktunnel-wrapper@2.0.3
    └─┬ unzip@0.1.11
      └─┬ fstream@0.1.31
        └─┬ graceful-fs@3.0.11
          └── natives@1.1.6 

Yup, now it shows 1.1.6 and my test suite runs without error.