“KiCad BOM Wizard” error on Ubuntu 16.04

In my previous entry on how to generate a BOM in KiCad 4, I wrote about “KiCad BOM Wizard” from hashdefineelectronics.com which can produce both CSV and HTML output.

Their website is well documented. But I wasn’t able at first to use that script on my Ubuntu (xubuntu 16.04).

I carefully followed the setup steps: Installing Node.Js (sudo apt-get install nodejs), downloaded the script, put everything in place.
Here’s the failing initial command line:
node "/home/david/KiCad_BOM_Wizard-master/KiCad_BOM_Wizard.js" "%I" "%O.html"
And it returned the error shown below:

Run command:
node “/home/david/KiCad_BOM_Wizard-master/KiCad_BOM_Wizard.js” “/home/david/nrf24l01 node/1.0/nrf24l01_node.xml” “/home/david/nrf24l01 node/1.0/nrf24l01_node.html”

Command error. Return code -1

Error messages:
execvp(node, /home/david/KiCad_BOM_Wizard-master/KiCad_BOM_Wizard.js, /home/david/nrf24l01 node/1.0/nrf24l01_node.xml, /home/david/nrf24l01 node/1.0/nrf24l01_node.html) failed with error 2!

Something was obviously wrong. And as I said in my previous entry, this is caused by a missing processor.

It turns out in Ubuntu 16.04 (and maybe some other versions), node command is not installed by sudo apt-get install nodejs!

You need either to use nodejs command (note the “js”) or to install nodejs-legacy which provides node command (without “js”).

sudo apt-get install nodejs-legacy

or

nodejs "/home/david/KiCad_BOM_Wizard-master/KiCad_BOM_Wizard.js" "%I" "%O.html"

Now, everything works!

Leave a Reply

Your email address will not be published. Required fields are marked *