Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm particle-cli failing. #119

Closed
Applepi opened this issue Sep 9, 2015 · 17 comments
Closed

npm particle-cli failing. #119

Applepi opened this issue Sep 9, 2015 · 17 comments

Comments

@Applepi
Copy link

Applepi commented Sep 9, 2015

npm WARN engine hawk@3.1.0: wanted: {"node":">=0.10.32"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN engine cryptiles@2.0.5: wanted: {"node":">=0.10.40"} (current: {"node":"0.10.29","npm":"1.4.21"})
\

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

npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm ERR! serialport@1.7.4 install: node-pre-gyp install --fallback-to-build
npm ERR! Exit status 1
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.16.0-4-amd64
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "particle-cli"
npm ERR! cwd /home/nota
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/nota/npm-debug.log
npm ERR! not ok code 0

@Applepi
Copy link
Author

Applepi commented Sep 9, 2015

fixed by installing nodejs-legacy

@brycekahle
Copy link
Contributor

Can you post the entire contents of the npm-debug.log file? This appears to be missing crucial details.

@RocketPop
Copy link

This happened to me using the osx installer from nodejs.org ( currently https://nodejs.org/dist/v4.1.1/node-v4.1.1.pkg ). I uninstalled that whole mess and used brew to install node instead and then the particle-cli install succeeded.

@brycekahle
Copy link
Contributor

@RocketPop that is because node 4.0 is not supported yet. See https://github.com/spark/particle-cli#known-issues

@RocketPop
Copy link

Thanks for the confirmation, Bryce. It might be nice if someone could put a note to this effect in all the readme/setup/getting started guides where they all say to go install node and save some other folks some confusion :)

@jmagnuson
Copy link

Should this be working now? I see 356dbe4 has removed the mentioned comment, but I'm still getting the same error message (attempted both with v4.2.1 as well as v3.3.1/io.js).

@KarbonDallas
Copy link
Contributor

@jmagnuson the newest version of the CLI supports Node 4.x

@brightredchilli
Copy link

@emilyrose - I'm still running into this issue. I've done as much poking as I can with all the dependencies as I could, but I'm stuck.
I get install warnings when installing particle-cli, and they appear to be in serialport:

 CXX(target) Release/obj.target/serialport/src/serialport.o
  CXX(target) Release/obj.target/serialport/src/serialport_unix.o
../src/serialport_unix.cpp:695:20: warning: comparison of array 'device.locationId' not equal to a null pointer is always true [-Wtautological-pointer-compare]
        if (device.locationId != NULL) {
            ~~~~~~~^~~~~~~~~~    ~~~~
../src/serialport_unix.cpp:698:20: warning: comparison of array 'device.vendorId' not equal to a null pointer is always true [-Wtautological-pointer-compare]
        if (device.vendorId != NULL) {
            ~~~~~~~^~~~~~~~    ~~~~
../src/serialport_unix.cpp:701:20: warning: comparison of array 'device.productId' not equal to a null pointer is always true [-Wtautological-pointer-compare]
        if (device.productId != NULL) {
            ~~~~~~~^~~~~~~~~    ~~~~
../src/serialport_unix.cpp:704:20: warning: comparison of array 'device.manufacturer' not equal to a null pointer is always true [-Wtautological-pointer-compare]
        if (device.manufacturer != NULL) {
            ~~~~~~~^~~~~~~~~~~~    ~~~~
../src/serialport_unix.cpp:707:20: warning: comparison of array 'device.serialNumber' not equal to a null pointer is always true [-Wtautological-pointer-compare]
        if (device.serialNumber != NULL) {
            ~~~~~~~^~~~~~~~~~~~    ~~~~
5 warnings generated.
  CXX(target) Release/obj.target/serialport/src/serialport_poller.o
  SOLINK_MODULE(target) Release/serialport.node
  COPY /Users/ying/.nvm/versions/node/v4.2.1/lib/node_modules/particle-cli/node_modules/serialport/build/serialport/v2.0.1/Release/node-v46-darwin-x64/serialport.node
  TOUCH Release/obj.target/action_after_build.stamp

and when I check npm afterwards, it reports that the dependencies serialport, node-pre-gyp, readable-stream, and string-decoder failed to install/have errors.

The particle-cli appears to work, and it logs in just fine, but becomes irresponsive trying to provision the device:

[22:32:53][ying@arugula ~]$particle setup wifi
? Should I scan for nearby Wi-Fi networks? Yes
? Select the Wi-Fi network with which you wish to connect your device: [rescan networks]
? Select the Wi-Fi network with which you wish to connect your device: network
? Should I try to auto-detect the wireless security type? Yes

^ cli becomes completely irresponsive after this point. all calls to particle serial don't work, except 'list'. particle get throws an exception - clearly the install is very broken.

This thread points to an issue with el capitan:
serialport/node-serialport#578 (comment)

which leads to this, which is supposedly a the fix, I can verify that serialport 2.0.1 is the version npm tried to install.
serialport/node-serialport#552

Sadly it still does not work for me. I'm running OSX 10.11 El Capitan, node v4.2.1. I've installed xcode and all command line tools. Any ideas what could help? Could someone else confirm that they got particle working with El Capitan? Are there other ways of setting up the device through some other means?

@KarbonDallas
Copy link
Contributor

@brightredchilli I'm sorry to hear you're still having trouble!

I can confirm that I've got the CLI working with node 4.2.0 and OS X 10.11 El Capitan.
Here is how things go for me: https://gist.github.com/emilyrose/d8ac3b4b24d437202133

One possible solution is to just downgrade to node 0.12 until whatever lingering OS X issues remain are flushed out.

EDIT: I updated to Node 4.2.1 prior to that gist, actually.

@brightredchilli
Copy link

I actually have tried many versions of node from 0.11 to 4.2.1, and I get the same error every time. This leads me to believe that I have an issue compiling node-pre-gyp from source(since there is no binary for my system). I'll be looking there and will post back here if I find anything.

@KarbonDallas
Copy link
Contributor

@brightredchilli would you be willing to try with version 1.8.13 of the CLI? 😸

@brightredchilli
Copy link

Oh wow that is a fresh release! Sure! I just tried - I still notice the build errors - but I don't have a photon with me to check the setup right now. I'll let you know tonight.

@ktodyruik
Copy link

I just had the same issue on OS Yosemite. I tried both node 4.2.4 and 5.3.0.

@kennethlimcp
Copy link
Contributor

@ktodyruik what's the error log saying?

@ktodyruik
Copy link

The pkg installations of node from the node website (4.2.4 and 5.3.0) don't seem to be working with particle-cli. I took @RocketPop 's suggestion, installing node with brew and particle-cli installed.

brew install node

Brew installed this version 0.10.32 which works with particle-cli.

$ node -v
v0.10.32

@jrmoulton
Copy link

sudo npm install -g particle-cli
Password:
/

serialport@2.0.5 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/jaredmoulton/.node-gyp/0.10.41"
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.10.41/common.gypi', needed byMakefile'. 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:270:23)
gyp ERR! stack at ChildProcess.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:820:12)
gyp ERR! System Darwin 15.2.0
gyp ERR! command "/usr/local/Cellar/node010/0.10.41/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/Release/node-v11-darwin-x64/serialport.node" "--module_name=serialport" "--module_path=/usr/local/lib/node_modules/particle-cli/node_modules/serialport/build/Release/node-v11-darwin-x64"
gyp ERR! cwd /usr/local/lib/node_modules/particle-cli/node_modules/serialport
gyp ERR! node -v v0.10.41
gyp ERR! node-gyp -v v3.0.1
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/Cellar/node010/0.10.41/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/Release/node-v11-darwin-x64/serialport.node --module_name=serialport --module_path=/usr/local/lib/node_modules/particle-cli/node_modules/serialport/build/Release/node-v11-darwin-x64' (1)
node-pre-gyp ERR! stack at ChildProcess. (/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:98:17)
node-pre-gyp ERR! stack at maybeClose (child_process.js:766:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:833:5)
node-pre-gyp ERR! System Darwin 15.2.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.10.41
node-pre-gyp ERR! node-pre-gyp -v v0.6.13
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/Cellar/node010/0.10.41/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/Release/node-v11-darwin-x64/serialport.node --module_name=serialport --module_path=/usr/local/lib/node_modules/particle-cli/node_modules/serialport/build/Release/node-v11-darwin-x64' (1)
npm ERR! Darwin 15.2.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "particle-cli"
npm ERR! node v0.10.41
npm ERR! npm v2.14.4
npm ERR! code ELIFECYCLE

npm ERR! serialport@2.0.5 install: node-pre-gyp install --fallback-to-build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the serialport@2.0.5 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/jaredmoulton/ownCloud/npm-debug.log

This is the error I get with node v0.10.41

@kennethlimcp
Copy link
Contributor

The error is stated here:

gyp WARN EACCES user "root" does not have permission to access the dev dir "/Users/jaredmoulton/.node-gyp/0.10.41"

and as mentioned in the docs: https://docs.npmjs.com/getting-started/fixing-npm-permissions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants