Troubles installing node-serialport during the spark-cli install on Windows

I had installed all necessary x64 parts under Windows-7 x64.
The command:

npm install -g node-gyp

was executed well.
The following installation of the

npm install -g spark-cli

generates some mysterious errors:

C:\Users\sparki\AppData\Roaming\npm\node_modules\spark-cli\node_modules\serialport>node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild
Die Projekte in dieser Projektmappe werden nacheinander erstellt. Um eine parallele Erstellung zu ermöglichen, müssen Sie den Schalter "/m" hinzufügen.
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.Cpp.InvalidPlatform.Targets(23,7): error MSB8007: The Platform for project 'serialport.vcxproj' is invalid.  Platform='x64'. You may be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Platform that doesn't exist for this project. [C:\Users\sparki\AppData\Roaming\npm\node_modules\spark-cli\node_modules\serialport\build\serialport.vcxproj]
gyp ERR! build error
gyp ERR! stack Error:`C:\windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\sparki\AppData\Roaming\npm\node_modules\spark-cli\node_modules\serialport
gyp ERR! node -v v0.10.26
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok

and after some well done npm http GET instructions:

npm ERR! serialport@1.3.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the serialport@1.3.1 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-gyp rebuild
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 Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "spark-cli"
npm ERR! cwd C:\Users\sparki
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm http 304
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\Users\sparki\npm-debug.log
npm ERR! not ok code 0

It seems that there is a Microsoft.Cpp problem. Does anybody know which potentioal “solution file” have been missing?
Does anybody have a hint to fix this issue?
Thanx in advance

The issue is with the serialport npm module

I had this before. Let me find the solution :slight_smile:

You probably have:

  1. visual studio express 2013

  2. python 2.x.x

Installed already?

Hello kennethlimcp,
Yes - but I have Visual studio 2010 express.
for Python I was going back to 2.7.6
Thx for your reply

If you would like to try,

upgrade to Visual Studio Express 2013 edition. I read online that there’s issues with Visual Studio 2010 with serialport module :smile:

1 Like

Updated the topic to reflect the errors,


Thanks for your expertise. After half a hour felt and 3.5GB Installed Microsoft

npm install -g spark-cli

has installed without errors - yeah!.
For other “windows” spark friends it would be nice to adapt your tutorial.
So - lets hurry to test the new cli world.
Thanks for your help


Please switch from serialport to JSSC or the older RXTX which do not need to compile a shim for Windows. Requiring users to install Visual Studio just for serial communication is ridiculous.


Hi @KanyonKris,

Thanks for the feedback! I agree the install isn’t pretty right now, we’re working on making packaged installers with binaries of the libraries for each system so this is easier. Something like JSSC might be nice, but it would just trade compilation tools for a Java dependency, no?


Dave, yes, it’s a pick-your-poison situation. IMO, the Java route with JSSC or RXTX is less hassle.

I like your thinking, packaged installers would be much easier. In fact I looked for compiled binaries of the serial shim program but couldn’t find any. I don’t understand why the serialport devs don’t go this route, maybe there are licensing issues.

1 Like

@kennethlimcp @Dave I have identical problem, but I already have Visual Studio 2013 installed What should I do?

Are you using Python 2.x ?

1 Like

I’m not directly using it, but Python 3.3.2 is installed for other stuff to work

1 Like

You will need python 2.x as mentioned in the docs in order to install serialport. You might want to try that :slight_smile:

1 Like