How fix this bug particle-cli? I've installed tensorflow, new python

I don’t know what happened? I can’t get particle to work. I remember I installed tensorflow, new python.
few months later. I plug in spark core. I can’t get particle to work. -bash: particle: command not found

I reinstall serialport. I don’t what this is
"serialport@6.2.0 install: prebuild-install || node-gyp rebuild"

  • reinstalling serialport, npm, etc. I have something like this.


npm WARN saveError ENOENT: no such file or directory, open '/Users/imac/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/imac/package.json'
npm WARN imac No description
npm WARN imac No repository field.
npm WARN imac No README data
npm WARN imac No license field.

Reinstall particle-cli

prebuild-install WARN install EACCES: permission denied, access '/Users/imac/.npm'
gyp ERR! configure error 
gyp ERR! stack Error: Python executable "/Users/imac/anaconda3/bin/python" is v3.6.4, which is not supported by gyp.
gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.
gyp ERR! stack     at PythonFinder.failPythonVersion (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:492:19)
gyp ERR! stack     at PythonFinder.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:474:14)
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:273:7)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at maybeClose (internal/child_process.js:957:16)
gyp ERR! stack     at (internal/child_process.js:378:11)
gyp ERR! stack     at Socket.emit (events.js:182:13)
gyp ERR! stack     at Pipe._handle.close [as _onclose] (net.js:598:12)
gyp ERR! System Darwin 17.5.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/particle-cli/node_modules/serialport
gyp ERR! node -v v10.1.0
gyp ERR! node-gyp -v v3.6.2
ygyp ERR! not ok 
npm ERR! errno 1
npm ERR! serialport@6.2.0 install: `prebuild-install || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the serialport@6.2.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/imac/.npm/_logs/2018-05-22T23_41_19_330Z-debug.log

Have you tried this?

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

Got it. it works.
Need to reinstall Python2 &3