Node version mismatch issue

####1. Describe Your Issue
Dear Jibo Team,

Could you let me know what node.js’s version is used in Electron for Jibo SDK?

I’m really trying to use native node module for jibo skill.
However, I was faced with an issue like below.
“Module version mismatch, Expected 46, got 50”.

To resolve this issue, I tried to rebuild the native node module using electron-rebuild.
Unfortunately, it is very hard to find the matched version.

It would be very appreciated, if you could let me know how to solve this issue or exact node’s version in Jibo’s Electron.

Thanks.

####2. Your Current Setup with SDK

Providing details about your system/SDK setup can save time by pre-answering common questions the community may ask.

  • Operating System: Mac
  • Amount of RAM:
  • Node Version: native node version 6.9.1
  • Atom version: 1.11.1
  • Does it say {$project} in your Run Directory area? (to right of simulator play button)

I have recreated your setup (Mac El Capitan 10.11.6, Atom Version 1.11.1 and I have used nodes prior releases to install node 6.9.1 on my mac). You should keep in mind that we recommend having an earlier 4.5.x version of node installed for the current Jibo SDK (1.7.1) as seen in our system requirements here.

Even with your same (6.9.1) node version installed on a Mac I am not able to recreate that error you are seeing so I may need some extra information to best look into this for you.

Could you give me a little more detail about when you see this error:

  1. It sounds like you only see this error after installing a specific node module, is that correct or are you seeing this error as soon as you install the Jibo SDK?

  2. If you click Jibo -> New Project in the top menu of Atom and hit the green play button for the new project do you see any errors in the simulator’s console? (view -> developer -> developer tools at the top of the simulator window)

  3. If you are only seeing this error after installing a specific node module could you let me know which one? That will allow me to further reproduce and provide as much direction as I can for how you might get that in place for your skill.

Thank you for your patience as I help look into this!

First of all, thank you for your effort.

Please find my answer below.

  1. It sounds like you only see this error after installing a specific node module, is that correct or are you seeing this error as soon as you install the Jibo SDK?
    [Jisun] I only see this error after installing a specific node module. When I use that node module in my skill, this error happened. If I don’t use that node module, it works fine.

  2. If you click Jibo -> New Project in the top menu of Atom and hit the green play button for the new project do you see any errors in the simulator’s console? (view -> developer -> developer tools at the top of the simulator window)
    [Jisun] No errors. It works fine.

  3. If you are only seeing this error after installing a specific node module could you let me know which one? That will allow me to further reproduce and provide as much direction as I can for how you might get that in place for your skill.
    [Jisun] node-java

[Reproduced steps]
npm install --save-dev electron-rebuild
npm install --save-dev electron-prebuilt
npm install java
./node_modules/.bin/electron-rebuild

Thanks.

Thank you very much for the extra details and the steps you have seen reproduce the issue. Very helpful!

I attempted to install java into a new SDK skill (Jibo -> New Project) and also received errors but different errors from the one that you saw.

In both cases it appears like the issue is likely caused by the Java platform in place locally.

I was able to clear up errors and successfully npm install java without needing to do any rebuilding. I did this via the following steps that will hopefully clear things up for you as well:

  1. I installed JDK 8u111 with NetBeans 8.2 seen here.

  2. I created a new Jibo project as a test (Jibo -> New Project)

  3. I opened the the skill’s package.json file file and added java to the dependencies as seen in the below image. If you do not specify a java version in your dependencies you will likely get errors.

The latest for that Java environment appears to be 0.8.0. I tested specifying both “0.8.0” in package.json and specifying “latest.” Both worked just fine:

4.I then cd'd into the top level of my skill and ran npm install java or npm install java@0.8.0 again, both should work.

This installed java without throwing any errors in terminal.

If you continue to have difficulty or if you have any trouble using the module after installing it may have to do with java itself so I may be limited in the direction I can provide but I will provide any help that I can.

If you do continue to see trouble installing the module if you could please send a screenshot or copy/paste of the error you are getting in terminal.

Thank you again for your time!

1 Like

I have followed your steps.
Java has been installed without any errors.

But when I attempt to use the java module into a new skill, I was faced with an issue the same as previous one.
Please see the error below.

  1. in the “index.js” file, I have added the line below.
    let jibo = require(‘jibo’);
    let javaVar = require(‘java’); //just added this line for testing

  2. Press ‘Run’ green button to execute the simulator. After that an error happened like below.
    in the console window,
    ‘Uncaught Error: Module version mismatch. Expected 46, got 48. ATOM_SHELL_ASAR.js:137’

This error has also happened at the first time I tried to use the java module.

Could you take a look at this again?
Any help will be appreciated.

Thank you.

I am not able to reproduce that error following those same steps. I will absolutely take a further look for you but, again, because this is impacted by the java module after installation there may be a limit to how much I can help.

To confirm, I created a new skill (Jibo -> New Project) and added the "java": "latest" line to the skill’s package.json. I then ran npm install java and was able to install the module without any errors.

I then added the same line you did to the index.js file as seen in this screen:

I was then able to hit the green play button and run the default skill that comes with a new project (Jibo doing a brief PlayAnimation behavior followed by a PlayAudio) without any errors in the developer console.

If you are comfortable doing so, could you send me a zip or a github link of a new project that you added java to using the steps we have discussed. This will allow me to take a closer look for you and provide any further direction that I can.

Thank you again for your time!

Could you let me know what node’s version is used?
I’d like to change the node version in my mac.

When I tested above I had node 6.9.1 installed but we recommend for using our current SDK (1.7.1) that you have Node.js v4.5.0 installed.

I hope that is helpful!

2 Likes

I have changed my version of Node.js from v.6.9.1 to v.4.5.0 as you mentioned before.
After that, I was able to clear up errors and successfully use the node-java module without needing to do any further steps.

I did this via the following steps:

  1. Downgrade Node.js using npm
    sudo npm cache clean -f
    sudo npm install -g n
    sudo n 4.5.0

  2. Created a new Jibo project as a test (Jibo-> New Project)

  3. Opend the skill’s package.json and added java to the dependencies.

  4. npm install java

  5. Just Added the code below to the index.js file.
    let javaVar = require(‘java’);

  6. Run the jibo skill

I could run the skill without any errors and then I could use the java module.

Thank you very much for your time and support! :slight_smile:

4 Likes