Can't install particle-cli on Linux, and core won't connect over Wi-Fi [Solved]

Are there any other options I have available to salvage the device outside of reinstalling my OS? Is there not a “non-cloud-based” solution for getting my core up and running? It’s pretty frustrating that I’m forced to use the cloud, but things only work about 80% of the time. Unacceptable.

which nodejs

nodejs -v

npm -v

sudo npm install -g particle-cli
> serialport@1.7.4 install /usr/local/lib/node_modules/particle-cli/node_modules/serialport
> node-pre-gyp install --fallback-to-build

/usr/bin/env: node: No such file or directory
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
npm ERR! serialport@1.7.4 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 127
npm ERR! 
npm ERR! Failed at the serialport@1.7.4 install script.
npm ERR! This is most likely a problem with the serialport package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-pre-gyp install --fallback-to-build
npm ERR! You can get their info via:
npm ERR!     npm owner ls serialport
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.19.0-18-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "particle-cli"
npm ERR! cwd /home/brad
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.4.21
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/brad/npm-debug.log
npm ERR! not ok code 0

In typical fashion, I solved the problem 5 minutes after PUBLICLY asking the question… Go figure.

For anyone having similar issues, I fixed this by running:

sudo apt-get install nodejs-legacy

then when i ran

sudo npm install -g particle-cli

everything was just fine. Sorry for the mini-rant. :smiley:


I had a similar problem, thanks for the tip about installing nodejs-legacy. Works great for me too.

1 Like

Glad you got it figured out! Marked this thread as solved. :smile: