Issues installing particle-cli on Mac OS X 10.3.3

Hello forum,

I’m having issues installing particle-cli on my Mac. The terminal responses and errors are below.

Any ideas?

Thank you!
Rahul

Rahuls-MacBook-Pro:~ Rahul$ sudo npm install -g particle-cli
Password:
npm WARN engine particle-cli@1.5.8: wanted: {"node":"^0.10.0"} (current: {"node":"0.12.3","npm":"2.9.1"})
/
> serialport@1.7.1 install /usr/local/lib/node_modules/particle-cli/node_modules/serialport
> node-pre-gyp install --fallback-to-build

gyp WARN EACCES user "root" does not have permission to access the dev dir "/Users/Rahul/.node-gyp/0.12.3"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/particle-cli/node_modules/serialport/.node-gyp"
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

make: *** No rule to make target `../.node-gyp/0.12.3/common.gypi', needed by `Makefile'.  Stop.
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:269:23)
gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Darwin 14.3.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/usr/local/lib/node_modules/particle-cli/node_modules/serialport/build/serialport/v1.7.1/Release/node-v14-darwin-x64/serialport.node" "--module_name=serialport" "--module_path=/usr/local/lib/node_modules/particle-cli/node_modules/serialport/build/serialport/v1.7.1/Release/node-v14-darwin-x64"
gyp ERR! cwd /usr/local/lib/node_modules/particle-cli/node_modules/serialport
gyp ERR! node -v v0.12.3
gyp ERR! node-gyp -v v1.0.3
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/usr/local/lib/node_modules/particle-cli/node_modules/serialport/build/serialport/v1.7.1/Release/node-v14-darwin-x64/serialport.node --module_name=serialport --module_path=/usr/local/lib/node_modules/particle-cli/node_modules/serialport/build/serialport/v1.7.1/Release/node-v14-darwin-x64' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/particle-cli/node_modules/serialport/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
node-pre-gyp ERR! stack     at maybeClose (child_process.js:1015:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
node-pre-gyp ERR! System Darwin 14.3.0
node-pre-gyp ERR! command "node" "/usr/local/lib/node_modules/particle-cli/node_modules/serialport/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /usr/local/lib/node_modules/particle-cli/node_modules/serialport
node-pre-gyp ERR! node -v v0.12.3
node-pre-gyp ERR! node-pre-gyp -v v0.6.7
node-pre-gyp ERR! not ok 
Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/usr/local/lib/node_modules/particle-cli/node_modules/serialport/build/serialport/v1.7.1/Release/node-v14-darwin-x64/serialport.node --module_name=serialport --module_path=/usr/local/lib/node_modules/particle-cli/node_modules/serialport/build/serialport/v1.7.1/Release/node-v14-darwin-x64' (1)
npm ERR! Darwin 14.3.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "particle-cli"
npm ERR! node v0.12.3
npm ERR! npm  v2.9.1
npm ERR! code ELIFECYCLE

npm ERR! serialport@1.7.1 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the serialport@1.7.1 install script 'node-pre-gyp install --fallback-to-build'.
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! Please include the following file with any support request:
npm ERR!     /Users/Rahul/npm-debug.log

Hey rsangole,

I hope all is well. I had the same problem and solved it using the following tutorial.

https://docs.npmjs.com/getting-started/fixing-npm-permissions

Hope it works !

odlh