I’m still struggling with this. Completely uninstalled/reinstalled node. Tried all of the above tricks (installing node-gyp and serialport) but no luck. One thing I see in here that I don’t see in the other posts is the traceback.
Any ideas???
~$ sudo npm install -g spark-cli
|
`> serialport@1.4.5 install /usr/local/lib/node_modules/spark-cli/node_modules/serialport
> node-pre-gyp install --fallback-to-build
Traceback (most recent call last):
File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 11, in <module>
import gyp
File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 8, in <module>
import gyp.input
File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 873
except ImportError as e:
^
SyntaxError: invalid syntax
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:343:16)
gyp ERR! stack at ChildProcess.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:810:12)
gyp ERR! System Darwin 14.0.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--name=serialport" "--configuration=Release" "--module_name=serialport" "--version=1.4.5" "--major=1" "--minor=4" "--patch=5" "--runtime=node" "--node_abi=node-v11" "--platform=darwin" "--target_platform=darwin" "--arch=x64" "--target_arch=x64" "--module_main=./serialport" "--host=https://node-serialport.s3.amazonaws.com/" "--module_path=/usr/local/lib/node_modules/spark-cli/node_modules/serialport/build/serialport/v1.4.5/Release/node-v11-darwin-x64" "--remote_path=./serialport/v1.4.5/Release/" "--package_name=node-v11-darwin-x64.tar.gz" "--staged_tarball=build/stage/serialport/v1.4.5/Release/node-v11-darwin-x64.tar.gz" "--hosted_path=https://node-serialport.s3.amazonaws.com/serialport/v1.4.5/Release/" "--hosted_tarball=https://node-serialport.s3.amazonaws.com/serialport/v1.4.5/Release/node-v11-darwin-x64.tar.gz"
gyp ERR! cwd /usr/local/lib/node_modules/spark-cli/node_modules/serialport
gyp ERR! node -v v0.10.32
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node rebuild --name=serialport --configuration=Release --module_name=serialport --version=1.4.5 --major=1 --minor=4 --patch=5 --runtime=node --node_abi=node-v11 --platform=darwin --target_platform=darwin --arch=x64 --target_arch=x64 --module_main=./serialport --host=https://node-serialport.s3.amazonaws.com/ --module_path=/usr/local/lib/node_modules/spark-cli/node_modules/serialport/build/serialport/v1.4.5/Release/node-v11-darwin-x64 --remote_path=./serialport/v1.4.5/Release/ --package_name=node-v11-darwin-x64.tar.gz --staged_tarball=build/stage/serialport/v1.4.5/Release/node-v11-darwin-x64.tar.gz --hosted_path=https://node-serialport.s3.amazonaws.com/serialport/v1.4.5/Release/ --hosted_tarball=https://node-serialport.s3.amazonaws.com/serialport/v1.4.5/Release/node-v11-darwin-x64.tar.gz' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/spark-cli/node_modules/serialport/node_modules/node-pre-gyp/lib/util/compile.js:76:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:98:17)
node-pre-gyp ERR! stack at maybeClose (child_process.js:756:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:823:5)
node-pre-gyp ERR! System Darwin 14.0.0
node-pre-gyp ERR! command "node" "/usr/local/lib/node_modules/spark-cli/node_modules/serialport/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /usr/local/lib/node_modules/spark-cli/node_modules/serialport
node-pre-gyp ERR! node -v v0.10.32
node-pre-gyp ERR! node-pre-gyp -v v0.5.19
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/bin/node rebuild --name=serialport --configuration=Release --module_name=serialport --version=1.4.5 --major=1 --minor=4 --patch=5 --runtime=node --node_abi=node-v11 --platform=darwin --target_platform=darwin --arch=x64 --target_arch=x64 --module_main=./serialport --host=https://node-serialport.s3.amazonaws.com/ --module_path=/usr/local/lib/node_modules/spark-cli/node_modules/serialport/build/serialport/v1.4.5/Release/node-v11-darwin-x64 --remote_path=./serialport/v1.4.5/Release/ --package_name=node-v11-darwin-x64.tar.gz --staged_tarball=build/stage/serialport/v1.4.5/Release/node-v11-darwin-x64.tar.gz --hosted_path=https://node-serialport.s3.amazonaws.com/serialport/v1.4.5/Release/ --hosted_tarball=https://node-serialport.s3.amazonaws.com/serialport/v1.4.5/Release/node-v11-darwin-x64.tar.gz' (1)
npm ERR! serialport@1.4.5 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the serialport@1.4.5 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 Darwin 14.0.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "spark-cli"
npm ERR! cwd /Users/mauricio
npm ERR! node -v v0.10.32
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0
~$ python
Python 2.5 (r25:51918, Sep 19 2006, 08:49:13)
[GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
xcode command line tools are installed. Can’t install serial port (output below). This is happening with both a Mavericks and Yosemite machine. Does the syntax error mean anything to you?
~$ sudo npm install serialport
Password:
-
> serialport@1.4.6 install /Users/mauricio/node_modules/serialport
> node-pre-gyp install --fallback-to-build
Traceback (most recent call last):
File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 11, in <module>
import gyp
File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 8, in <module>
import gyp.input
File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 873
except ImportError as e:
^
SyntaxError: invalid syntax
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:343:16)
gyp ERR! stack at ChildProcess.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:810:12)
gyp ERR! System Darwin 14.0.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--name=serialport" "--configuration=Release" "--module_name=serialport" "--version=1.4.6" "--major=1" "--minor=4" "--patch=6" "--runtime=node" "--node_abi=node-v11" "--platform=darwin" "--target_platform=darwin" "--arch=x64" "--target_arch=x64" "--module_main=./serialport" "--host=https://node-serialport.s3.amazonaws.com/" "--module_path=/Users/mauricio/node_modules/serialport/build/serialport/v1.4.6/Release/node-v11-darwin-x64" "--remote_path=./serialport/v1.4.6/Release/" "--package_name=node-v11-darwin-x64.tar.gz" "--staged_tarball=build/stage/serialport/v1.4.6/Release/node-v11-darwin-x64.tar.gz" "--hosted_path=https://node-serialport.s3.amazonaws.com/serialport/v1.4.6/Release/" "--hosted_tarball=https://node-serialport.s3.amazonaws.com/serialport/v1.4.6/Release/node-v11-darwin-x64.tar.gz"
gyp ERR! cwd /Users/mauricio/node_modules/serialport
gyp ERR! node -v v0.10.32
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node rebuild --name=serialport --configuration=Release --module_name=serialport --version=1.4.6 --major=1 --minor=4 --patch=6 --runtime=node --node_abi=node-v11 --platform=darwin --target_platform=darwin --arch=x64 --target_arch=x64 --module_main=./serialport --host=https://node-serialport.s3.amazonaws.com/ --module_path=/Users/mauricio/node_modules/serialport/build/serialport/v1.4.6/Release/node-v11-darwin-x64 --remote_path=./serialport/v1.4.6/Release/ --package_name=node-v11-darwin-x64.tar.gz --staged_tarball=build/stage/serialport/v1.4.6/Release/node-v11-darwin-x64.tar.gz --hosted_path=https://node-serialport.s3.amazonaws.com/serialport/v1.4.6/Release/ --hosted_tarball=https://node-serialport.s3.amazonaws.com/serialport/v1.4.6/Release/node-v11-darwin-x64.tar.gz' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/Users/mauricio/node_modules/serialport/node_modules/node-pre-gyp/lib/util/compile.js:76:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:98:17)
node-pre-gyp ERR! stack at maybeClose (child_process.js:756:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:823:5)
node-pre-gyp ERR! System Darwin 14.0.0
node-pre-gyp ERR! command "node" "/Users/mauricio/node_modules/serialport/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/mauricio/node_modules/serialport
node-pre-gyp ERR! node -v v0.10.32
node-pre-gyp ERR! node-pre-gyp -v v0.5.19
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/bin/node rebuild --name=serialport --configuration=Release --module_name=serialport --version=1.4.6 --major=1 --minor=4 --patch=6 --runtime=node --node_abi=node-v11 --platform=darwin --target_platform=darwin --arch=x64 --target_arch=x64 --module_main=./serialport --host=https://node-serialport.s3.amazonaws.com/ --module_path=/Users/mauricio/node_modules/serialport/build/serialport/v1.4.6/Release/node-v11-darwin-x64 --remote_path=./serialport/v1.4.6/Release/ --package_name=node-v11-darwin-x64.tar.gz --staged_tarball=build/stage/serialport/v1.4.6/Release/node-v11-darwin-x64.tar.gz --hosted_path=https://node-serialport.s3.amazonaws.com/serialport/v1.4.6/Release/ --hosted_tarball=https://node-serialport.s3.amazonaws.com/serialport/v1.4.6/Release/node-v11-darwin-x64.tar.gz' (1)
npm ERR! serialport@1.4.6 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the serialport@1.4.6 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 Darwin 14.0.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "serialport"
npm ERR! cwd /Users/mauricio
npm ERR! node -v v0.10.32
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0
~$
I am having similar issues: spark-cli install fails at serialport@1.4.5, though the errors are slightly different (log below).
I have recently upgraded OS X to 10.10, updated Xcode, reinstalled the Xcode command line tools, and accepted the terms in the Xcode GUI. I'm able to install serialport 1.4.6 through npm, though spark-cli still tries to add 1.4.5.
CXX(target) Release/obj.target/serialport/src/serialport.o
CXX(target) Release/obj.target/serialport/src/serialport_unix.o
In file included from /usr/include/dispatch/dispatch.h:51:0,
from /System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:56,
from ../src/serialport_unix.cpp:12:
/usr/include/dispatch/object.h:143:15: error: expected unqualified-id before '^' token
typedef void (^dispatch_block_t)(void);
^
/usr/include/dispatch/object.h:143:15: error: expected ')' before '^' token
/usr/include/dispatch/object.h:362:3: error: 'dispatch_block_t' has not been declared
dispatch_block_t notification_block);
^
In file included from /System/Library/Frameworks/IOKit.framework/Headers/usb/IOUSBLib.h:27:0,
from ../src/serialport_unix.cpp:14:
/System/Library/Frameworks/IOKit.framework/Headers/usb/USB.h:599:23: error: too many #pragma options align=reset #pragma options align=reset
^
In file included from /System/Library/Frameworks/IOKit.framework/Headers/usb/IOUSBLib.h:27:0,
from ../src/serialport_unix.cpp:14:
/System/Library/Frameworks/IOKit.framework/Headers/usb/USB.h:769:23: error: too many #pragma options align=reset #pragma options align=reset
^
/System/Library/Frameworks/IOKit.framework/Headers/usb/USB.h:821:23: error: too many #pragma options align=reset #pragma options align=reset
^
/System/Library/Frameworks/IOKit.framework/Headers/usb/USB.h:839:23: error: too many #pragma options align=reset #pragma options align=reset
^
/System/Library/Frameworks/IOKit.framework/Headers/usb/USB.h:859:23: error: too many #pragma options align=reset #pragma options align=reset
^
make: *** [Release/obj.target/serialport/src/serialport_unix.o] Error 1
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:267:23)
gyp ERR! stack at ChildProcess.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:810:12)
gyp ERR! System Darwin 14.0.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--name=serialport" "--configuration=Release" "--module_name=serialport" "--version=1.4.5" "--major=1" "--minor=4" "--patch=5" "--runtime=node" "--node_abi=node-v11" "--platform=darwin" "--target_platform=darwin" "--arch=x64" "--target_arch=x64" "--module_main=./serialport" "--host=https://node-serialport.s3.amazonaws.com/" "--module_path=/usr/local/lib/node_modules/spark-cli/node_modules/serialport/build/serialport/v1.4.5/Release/node-v11-darwin-x64" "--remote_path=./serialport/v1.4.5/Release/" "--package_name=node-v11-darwin-x64.tar.gz" "--staged_tarball=build/stage/serialport/v1.4.5/Release/node-v11-darwin-x64.tar.gz" "--hosted_path=https://node-serialport.s3.amazonaws.com/serialport/v1.4.5/Release/" "--hosted_tarball=https://node-serialport.s3.amazonaws.com/serialport/v1.4.5/Release/node-v11-darwin-x64.tar.gz"
gyp ERR! cwd /usr/local/lib/node_modules/spark-cli/node_modules/serialport
gyp ERR! node -v v0.10.33
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node rebuild --name=serialport --configuration=Release --module_name=serialport --version=1.4.5 --major=1 --minor=4 --patch=5 --runtime=node --node_abi=node-v11 --platform=darwin --target_platform=darwin --arch=x64 --target_arch=x64 --module_main=./serialport --host=https://node-serialport.s3.amazonaws.com/ --module_path=/usr/local/lib/node_modules/spark-cli/node_modules/serialport/build/serialport/v1.4.5/Release/node-v11-darwin-x64 --remote_path=./serialport/v1.4.5/Release/ --package_name=node-v11-darwin-x64.tar.gz --staged_tarball=build/stage/serialport/v1.4.5/Release/node-v11-darwin-x64.tar.gz --hosted_path=https://node-serialport.s3.amazonaws.com/serialport/v1.4.5/Release/ --hosted_tarball=https://node-serialport.s3.amazonaws.com/serialport/v1.4.5/Release/node-v11-darwin-x64.tar.gz' (1)
node-pre-gyp ERR! stack at ChildProcess. (/usr/local/lib/node_modules/spark-cli/node_modules/serialport/node_modules/node-pre-gyp/lib/util/compile.js:76:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:98:17)
node-pre-gyp ERR! stack at maybeClose (child_process.js:756:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:823:5)
node-pre-gyp ERR! System Darwin 14.0.0
node-pre-gyp ERR! command "node" "/usr/local/lib/node_modules/spark-cli/node_modules/serialport/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /usr/local/lib/node_modules/spark-cli/node_modules/serialport
node-pre-gyp ERR! node -v v0.10.33
node-pre-gyp ERR! node-pre-gyp -v v0.5.19
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/bin/node rebuild --name=serialport --configuration=Release --module_name=serialport --version=1.4.5 --major=1 --minor=4 --patch=5 --runtime=node --node_abi=node-v11 --platform=darwin --target_platform=darwin --arch=x64 --target_arch=x64 --module_main=./serialport --host=https://node-serialport.s3.amazonaws.com/ --module_path=/usr/local/lib/node_modules/spark-cli/node_modules/serialport/build/serialport/v1.4.5/Release/node-v11-darwin-x64 --remote_path=./serialport/v1.4.5/Release/ --package_name=node-v11-darwin-x64.tar.gz --staged_tarball=build/stage/serialport/v1.4.5/Release/node-v11-darwin-x64.tar.gz --hosted_path=https://node-serialport.s3.amazonaws.com/serialport/v1.4.5/Release/ --hosted_tarball=https://node-serialport.s3.amazonaws.com/serialport/v1.4.5/Release/node-v11-darwin-x64.tar.gz' (1)
npm ERR! serialport@1.4.5 install: node-pre-gyp install --fallback-to-build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the serialport@1.4.5 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 Darwin 14.0.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "spark-cli"
npm ERR! cwd /Users/rtwomey
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0
I’ve got the same problem…OSX 10.10. I’ve tried all the fixes. I can install serialport with no errors, symlink doesn’t change anything, Xcode installed properly and agreement accepted…
I can’t help much since my OS is still on Mavericks and yet to upgrade to Yosemite,
@zachary installed on his new Mac recently and might be able to provide some clue on this.
So sudo npm install -g serialport gives no error?
Can you try sudo npm install -g serialport@1.4.5 just to be sure that is installs fine since that’s the version specified for spark-cli at this point in time?
Yeah sure enough that fails with the same errors. For a minute, because of that link, I thought that maybe I had installed homebrew's gcc but I checked and am running Apple's version.
I found a solution that worked for me! After some reading and working my way through those errors it was apparently a problem with node-gyp. I found a .node-gyp folder in my home directory so in an act of desperation I removed it.
rm -r ~/.node-gyp
I then tried to reinstall spark-cli and it worked and functions properly! I’m not sure what the ramifications of removing the ~/.node-gyp directory – there don’t yet seem to be any – but time should tell. I wasn’t too worried about it because I had removed all of my other node modules in preparation for removing and reinstalling node and npm as suggested elsewhere.
Anyway, for those frustrated by the same problem and willing to give it a shot I hope it works for you and doesn’t screw anything else up
Seems the serial package was fixed, I was able to install spark-cli without any magic, just sudo npm install -g spark-cli. Same command failed with above errors a week ago.
Yes. That doesn’t give the error about needing to be an Admin., but I get another set of errors, which I’m still working on:
> serialport@1.4.5 install /usr/local/lib/node_modules/spark-cli/node_modules/serialport
> node-pre-gyp install --fallback-to-build
env: node: No such file or directory
npm ERR! serialport@1.4.5 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 127
npm ERR!
npm ERR! Failed at the serialport@1.4.5 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 Darwin 14.1.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "spark-cli"
npm ERR! cwd /Users/msharris
npm ERR! node -v v0.10.35
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0