screepers / screeps-multimeter

The most useful tool on your screeps workbench.
MIT License
89 stars 28 forks source link

Cannot npm install, native deps failing to build #33

Closed Ramblurr closed 4 years ago

Ramblurr commented 4 years ago

On a fresh checkout of this repo if I do npm install, it fails when building the native bit of the bufferutil dependency:

sample:

../../nan/nan_object_wrap.h: In static member function ‘static void Nan::ObjectWrap::WeakCallback(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)’:
../../nan/nan_object_wrap.h:124:26: error: ‘class Nan::Persistent<v8::Object>’ has no member named ‘IsNearDeath’
  124 |     assert(wrap->handle_.IsNearDeath());
      |  

full log here: https://gist.github.com/Ramblurr/57b57b6bcb40ae21944ff4c94e34d128

This is on node version v12.16.1.

Is a particular version of node needed?

djD-REK commented 4 years ago

Most Screeps tools need node v10

Best regards, Derek

Derek R. Austin, PT, DPT, MS, BCTMB, LMT, CSCS

Join me on LinkedIn: https://www.linkedin.com/in/derek-austin/

On Fri, Jun 26, 2020, 4:56 AM Casey Link notifications@github.com wrote:

On a fresh checkout of this repo if I do npm install, it fails when building the native bit of the bufferutil dependency:

sample:

../../nan/nan_object_wrap.h: In static member function ‘static void Nan::ObjectWrap::WeakCallback(const v8::WeakCallbackInfo&)’:

../../nan/nan_object_wrap.h:124:26: error: ‘class Nan::Persistent’ has no member named ‘IsNearDeath’

124 | assert(wrap->handle_.IsNearDeath());

  |

full log here: https://gist.github.com/Ramblurr/57b57b6bcb40ae21944ff4c94e34d128

This is on node version v12.16.1.

Is a particular version of node needed?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/screepers/screeps-multimeter/issues/33, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMV42QRPHT3PPPSEE3C2IXTRYRPFDANCNFSM4OJEER2A .

Ramblurr commented 4 years ago

Did not know that.

SystemParadox commented 4 years ago

screeps-api needs to update their bufferutil dependency to fix this:

https://github.com/screepers/node-screeps-api/issues/54

Interestingly if you install node10, npm install, then install node12, it runs fine - so either we're not doing anything that uses nan or it's literally just a build problem.

SystemParadox commented 4 years ago

Actually it seems that you can even install this with node12 and ignore the errors, multimeter still works. I notice that bufferutil is listed as an optional dependency for screeps-api.

Ramblurr commented 4 years ago

Thanks for looking into this! Getting it working with node12 without errors would be very handy. Seems (from your other comment) that those optional deps aren't even used and could just be removed?

SystemParadox commented 4 years ago

screeps-api has updated to 1.12.2 which fixes this. You should just be able to run npm update to get the new version.