Particle-CLI not working on Ubuntu 17.10 running Node.JS 8.9.1 and NPM version 5.5.1

I ave been trying to install the particle-cli, and I cannot seem to get the particle-cli to work. I changed permissions in the appropriate folders but now the serialport module is apparently not working as it should. I have tried updating with the command below. no luck. seems to work for others but not my situation.

npm install -g --unsafe-perm node-pre-gyp npm serialport particle-cli

I have been able to install everything but, I just can’t seem to get it to start. I also have been to many of the posts in the community forum. None of them fix my problem.

! Error loading module ‘serialport’: Could not locate the bindings file. Tried:
→ /usr/local/lib/node_modules/particle-cli/node_modules/serialport/build/serialport.node
→ /usr/local/lib/node_modules/particle-cli/node_modules/serialport/build/Debug/serialport.node
→ /usr/local/lib/node_modules/particle-cli/node_modules/serialport/build/Release/serialport.node
→ /usr/local/lib/node_modules/particle-cli/node_modules/serialport/out/Debug/serialport.node
→ /usr/local/lib/node_modules/particle-cli/node_modules/serialport/Debug/serialport.node
→ /usr/local/lib/node_modules/particle-cli/node_modules/serialport/out/Release/serialport.node
→ /usr/local/lib/node_modules/particle-cli/node_modules/serialport/Release/serialport.node
→ /usr/local/lib/node_modules/particle-cli/node_modules/serialport/build/default/serialport.node
→ /usr/local/lib/node_modules/particle-cli/node_modules/serialport/compiled/8.9.1/linux/x64/serialport.node
Please reinstall the CLI again using npm install -g particle-cli

I have tried uninstalling and reinstalling so many times that when I install now it does not install NPM with Node.JS. I am at a loss. I have decided to walk away for now and ask for help.

does anyone seem to have a fresh idea on this because what is in the forums have not helped. I don’t usually post a problem because I can usually find it in the forum. lol

What worked for me was:
sudo npm install -g serialport@4.0.7 particle-cli --unsafe-perm

I had a long post on all the things that went wrong. Then stopped, tried uninstall/reinstall two more times and for some reason it worked. This time I installed, changed permissions on folders that where denied, and installed particle-cli in the same place I installed everything else. Previously I was installing particle-cli in a different directory. I think that was my mistake. That is the only thing I noticed I did.

thanks for the quick response

1 Like