When I tried to install Spark CLI and now with Particle CLI I get the following error messages:
Mac-Attack:node_modules geoff$ sudo npm install -g particle-cli
Password:
npm WARN engine particle-cli@1.5.11: wanted: {"node":"^0.10.0"} (current: {"node":"0.12.4","npm":"2.10.1"})
\
> serialport@1.7.4 install /usr/local/lib/node_modules/particle-cli/node_modules/serialport
> node-pre-gyp install --fallback-to-build
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
sh: node-pre-gyp: command not found
npm ERR! Darwin 14.3.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "particle-cli"
npm ERR! node v0.12.4
npm ERR! npm v2.10.1
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! serialport@1.7.4 install: `node-pre-gyp install --fallback-to-build`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the serialport@1.7.4 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! /usr/local/lib/node_modules/npm-debug.log
@kennethlimcp The install instructions at https://github.com/spark/particle-cli say to install node.js. Not a particular version of node.js. Sounds like something in the CLI install needs to be fixed. I spent a few minutes at node.js web site and it is not apparent how to install anything but the latest.
BTW, I stared installation from ~/
@mojtabacazi I already have /usr/bin and /usr/local/bin in my $PATH. But I tried what you suggest and it doesnāt work. Same error message with which I started thread.
Iām up and running. I was just putting some info out there. Following the instructions at https://github.com/spark/particle-cli didnāt work for me.
@screenintel Make sure you are an administrator on your machine and use sudo in front of all commands. Also, these instructions worked for me on a couple of Airs:
Just installed CLI on my new machine using this procedure (see top)
OS X 10.11.3
node 4.4.0
CLI 1.11.0
and it works fine.
Iām still forced to use this procedure because
npm install -g particle-cli
simply doesnāt work. Still blows up on serialport.
Mac-Attack:~ geoff$ sudo npm install -g particle-cli
> serialport@2.0.6 install /usr/local/lib/node_modules/particle-cli/node_modules/serialport
> node-pre-gyp install --fallback-to-build
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
sh: node-pre-gyp: command not found
npm ERR! Darwin 15.3.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "particle-cli"
npm ERR! node v4.4.0
npm ERR! npm v2.14.20
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! serialport@2.0.6 install: `node-pre-gyp install --fallback-to-build`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the serialport@2.0.6 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 information on how to open an issue for this project with:
npm ERR! npm bugs serialport
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
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/geoff/npm-debug.log
@kennethlimcp Worked like a charm! This should be included in the install instructions because the standard node install used 24561 as the owner on /usr/local/lib/node_modules.