Npm Install Issue (Robotic Add On)

I’m having trouble installing the robotic add on with npm install. When I go through the process of installing the add on using npm install, it throws an error saying that it cannot find the folders “node-addon-api” and “napi-thread-safe-callback” under the node_modules folder.

I tried cloning the folder using both git and GitHub Desktop, and by just downloading it as a zip file, but all threw the same error. I’m running on macOS 10.15.4 (Catalina), node version 12.18.0, and npm version 6.14.5. Any ideas on how to fix this?

Hi @CarterWS , welcome to the forum!
Would you mind posting the error stack trace?
Thanks!

Hi again @CarterWS,
could you also try re-installing Command Line Tools by doing:

xcode-select --install

Or if they are already installed:

sudo rm -rf /Library/Developer/CommandLineTools
xcode-select --install

Then go to the robotic addon folder and remove the npm_modules folder
And then npm install again.

Let me know if this works

Hi Anna, I tried re-installing Command Line Tools, but it still shows the same error. Here’s a picture of the error stack trace.

Just to make sure, have your restarted the terminal and deleted the npm_modules folder from the robotic addons folder?

Yep! After re-installing the Command Line Tools, I deleted the node modules folder from robotic addons, restarted my terminal, and still got the error stack above.

Can you include a bit more context? I think the error message stems from something a bit further up in the log

Here is all the messages I get after i do npm install.

Hi @CarterWS we made some updates to the boost nodejs library.

Can you do the following.

  1. delete the robotic and / or the basics add-on folder and replace it with the latest version from git.
  2. In the package.json file within that new folder you see a dependency reference to “wedoboostpoweredup”: “^2.1.4”
  3. Make sure that you have the latest xCode installed. When you open the latest xcode it will ask you to install new developer tools.
  4. npm install in the robotic / basic add-on folder.

If you still have problems, make sure that your not running any security software that is blocking your own compiled code.

Let me know if this worked for you.

Hi @valentin, I deleted and reinstalled the robotic add on, made sure that I saw the dependency reference to wedoboostpoweredup ^2.1.4, and then reinstalled xcode with the commands that Anna gave above, but the npm install still gives the same error as I was getting before.

I also checked my security preferences, but I don’t see anything that would be the issue there. I was also able to install the spatial core addons without an issue, so it seems to only be the robotic addon that’s giving me problems.

Can you type in your terminal node -v and tell me what version of node you’re seeing?

Apparently your compiler can not find node-addon-api and napi-thread-safe-callback in the global scope or it expects it to be in the local scope.

You could also try to install both in the local scope and see if this fixes the issue but let’s go step by step and first check if your node version is up to date.

node -v tells me it’s version 12.18.0

@CarterWS can you run this command also: xcodebuild -version
and let us know your xcode version

thanks

I’m running Xcode 11.5, Build version 11E608c. I apparently didn’t have Xcode installed, just the command line tools, but I went and installed it and tried to do the npm install again, and I came up with the same error.

@CarterWS It seems like your noble compile step tries to find local files that should exist global.

I will try to investigate a bit more what is going wrong. Meanwhile, we created an all in one solution for you to work with.

Just download the Edge.Server-3.2.0.dmg

Its a stand alone server application. No need to run nodejs and npm.

Hi @CarterWS we just released a new version for the edge server:

This version will fix the issues with the Lego Boost. Let me know if it works for you.