[Solved] Meteor 1.9 npm install error

Hi, I have updated to meter 1.9 from meteor While doing npm install on my production server I get following warning related to nan and time module

../../nan/nan_converters_43_inl.h:18:69: warning: ‘v8::MaybeLocal<v8::Boolean> v8::Value::ToBoolean(v8::Local<v8::Context>) const’ is deprecated: ToBoolean can never throw. Use Local version. [-Wdeprecated-declarations

and the error is

../../nan/nan_implementation_12_inl.h:103:42: error: cannot convert ‘v8::Isolate*’ to ‘v8::Local<v8::Context>’
  103 |   return scope.Escape(v8::Function::New( isolate

As a result of this error, installation of time module fails,

Failed at the time@0.11.4 install script.

Any suggestions on what is wrong and how I can resolve this error? Thanks

Compilation errors like these usually mean that the module is incompatible with your current node version.
Meteor 1.8 used Node 8 LTS while Meteor 1.9 uses Node 12 LTS.

I’m not sure if time is compatible with Node 12, it looks like the last mention of a node version in it’s updates is for Node 7

Is time a direct dependency of your project, or does another module depend on it?
My guess is that it’s a dependency of another package that you have installed.
You can run meteor npm list --tree to see which modules are bringing in other modules.

Thanks for the reply @coagmano. time is dependency of mongodb_s3_backup which backs up mongo database to s3. I am looking at alternative for it.

One more question, I can see 2 different github projects for mongodb_s3_backup library, https://github.com/FaridSafi/node-mongodb-s3-backup which is a fork of https://github.com/theycallmeswift/node-mongodb-s3-backup. The first one doesnt use time library.

Both these github projects instruct to install the library via the command npm install mongodb_s3_backup -g. How to ensure that a given library (first github project) gets installed when we run npm install command? Thanks.

you can look up which package you get by checking on npm:
The github link points to the non-forked version (makes sense)

You can directly install from github by providing the repo url as the version in package.json:

and lots of examples buried in the docs:

Also installing globally -g is a bad idea if the module is used in app code. I think they suggest it because the original author was using system cron to run the script

Just noticed the second one does still include the code for time, but it only runs if you pass a timezone to options:

1 Like

Thanks a lot @coagmano. The issue is time module is not working with node 12.x. There are several other modules that backup mongodb to s3. I will better try to use those. I will mark this as solved. Thanks.

1 Like