Problem with particle-cli


#1

Hi, All:

I installed the particle cli according to the instructions, but when I run it get an error (see below). I have the latest version of npm and node installed:

$ node --version
v8.11.1
$ npm --version
5.6.0

I went into /usr/local/lib/node_modules/particle-cli and ran npm rebuild, as instructed, but I still get the error shown.

I tried opening a new terminal window and running particle there, same error.

Can someone please help me out?

Thanks!

photons:particle-cli me $ particle setup wifi
Error loading command /usr/local/lib/node_modules/particle-cli/commands/SerialCommand.js Error: The module '/usr/local/lib/node_modules/particle-cli/node_modules/serialport/build/Release/serialport.node’
was compiled against a different Node.js version using
NODE_MODULE_VERSION 47. This version of Node.js requires
NODE_MODULE_VERSION 57. Please try re-compiling or re-installing
the module (for instance, using npm rebuild or npm install).
/usr/local/lib/node_modules/particle-cli/commands/SetupCommand/index.js:68
return serial.configureWifi();
^

TypeError: Cannot read property ‘configureWifi’ of undefined
at SetupCommand.setup (/usr/local/lib/node_modules/particle-cli/commands/SetupCommand/index.js:68:17)
at SetupCommand.runCommand (/usr/local/lib/node_modules/particle-cli/commands/BaseCommand.js:108:17)
at Interpreter.runCommand (/usr/local/lib/node_modules/particle-cli/lib/interpreter.js:93:13)
at Interpreter.handle (/usr/local/lib/node_modules/particle-cli/lib/interpreter.js:55:18)
at Object. (/usr/local/lib/node_modules/particle-cli/bin/particle.js:20:5)
at Module._compile (module.js:652:30)
at Object.Module._extensions…js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)


#2

Have you tried this?

sudo npm uninstall -g --unsafe-perm particle-cli
sudo npm install -g --unsafe-perm particle-cli

Trouble with CLI
Error in particle cli: Cannot find module 'core-js/modules/es.array.index-of' [SOLVED]
[SOLVED] CLI, Particle Identify trouble using Ubuntu
Particle-cli broken? "Unexpected token {" [WORKAROUND]
Particle-cli update fails on MacOS 10.13.6 due to python version?
Particle command line broke
#3

I tried the second line, and still got grief – but on my home computer I ran both and particle seems fine, so a) thank you for the suggestion, and b) I will try it again at work on Monday.