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

Error on "npm install johnny-five" with Windows 7 #48

Closed
ThomasDeutsch opened this issue Aug 8, 2012 · 34 comments
Closed

Error on "npm install johnny-five" with Windows 7 #48

ThomasDeutsch opened this issue Aug 8, 2012 · 34 comments
Labels

Comments

@ThomasDeutsch
Copy link

Hi everyone.
I tried to install johnny-five on my Windows system - anyone tried this??

@rwaldron
Copy link
Owner

rwaldron commented Aug 8, 2012

The latest Serialport supports Windows com ports however Johnny-Five has never been tested on Windows (that I know of). At this point I can say confidently that even if it had installed, it still wouldn't work because Johnny-Five's serial port detection only looks in /dev/.

I dont have a Windows machine at my disposal to do the work required to support the OS.

Sorry :(

@ThomasDeutsch
Copy link
Author

Ok, i think it is time for the Virtual Mashine now.
Thank you for your quick reply.

@rwaldron
Copy link
Owner

rwaldron commented Aug 8, 2012

I know it's a pain in the ass, but I'd like to encourage you to try and contribute the support for windows :)

@ThomasDeutsch
Copy link
Author

I will have a look into it.

2012/8/8 Rick Waldron notifications@github.com

I know it's a pain in the ass, but I'd like to encourage you to try and
contribute the support for windows :)


Reply to this email directly or view it on GitHubhttps://github.com//issues/48#issuecomment-7597282.

@dcherman
Copy link

CC Myself

FWIW I was able to get this installed with a simple npm install and have this working to a point, but firmata seems to hang on trying to connect, spitting back data endlessly. Added onto the Win7 support issue at firmata/firmata.js#7

@rwaldron
Copy link
Owner

Really appreciate all the windows platform contributions (even if they're bug reports!)

:)

@Jellyfrog
Copy link

Try newest node (0.8) and newest npm

But it seems like you don't have python in your path: "Can't find Python executable "python", you can set
the PYTHON env variable."

Try this:
http://docs.python.org/using/windows.html#excursus-setting-environment-variables

@ThomasDeutsch
Copy link
Author

I had Python 3.x installed. I needed Python 2.7.
Also my Visual Studio installation had no c++ builder - i am a c# developer and never thought i need that.

Set my env.-variable: PATH=%PATH%;C:\Python27

npm install johnny-five was no problem than ... everything installed correctly.
The only Problem is this: firmata/firmata.js#7

Well... and then we need to work on hat "/dev/..." in the johnny-five code.
Windows will only reference a port like "COM3".

@dcherman
Copy link

@ThomasDeutsch It's not too bad actually, the changes are pretty small.

Rather than using the current grep comment, my approach so far has been either

  • enumerate the registry with reg query ( but that requires admin rights ),
  • use powershell ( cmd: powershell [System.IO.Ports.SerialPort]::getportnames() )
  • WQL query

Powershell right now is my preferred approach I think as it's simple, doesn't seem to require admin privs, and spits out the exact output that's needed. Once firmata is working on Windows properly, I'll be able to do some more testing.

@rwaldron
Copy link
Owner

Are the windows port names always one of "COMn" where "n" is a number?

@ThomasDeutsch
Copy link
Author

I think this is node-serialport specific.
In my case it is always COMn.

I think serialport got that feature from serial-port2.
In the SerialPort2 doc i can find this:
portName - The name of the port to open. Example: Windows 'COM1', Linux '/dev/ttyUSB0'.

@rwaldron
Copy link
Owner

Yes, @voodootikigod and @joeferner combined Serialport and Serialport2. We're thinking the same way—I asked about COMn b/c I saw the same reference as you... I think we're onto something :)

Can we try to guess the COMm?

@voodootikigod
Copy link

you can use Windows Device Manager to identify the COMn values.

@voodootikigod
Copy link

I am confused about what the final issue is here, i feel like there are 8 different ones interleaved, what is still an issue ATM? Happy to help.

@rwaldron
Copy link
Owner

@voodootikigod it's all good :)

Johnny-Five does port detection for you, so we're brainstorming how to make it work on windows. @ThomasDeutsch @Jellyfrog @dcherman are working out implementation details :)

@voodootikigod
Copy link

Good luck on that, my response would be "Just use device manager".

On Monday, August 13, 2012 at 11:34 AM, Rick Waldron wrote:

@voodootikigod (https://github.com/voodootikigod) it's all good :)
Johnny-Five does port detection for you, so we're brainstorming how to make it work on windows. @ThomasDeutsch (https://github.com/ThomasDeutsch) @Jellyfrog (https://github.com/Jellyfrog) @dcherman (https://github.com/dcherman) are working out implementation details :)


Reply to this email directly or view it on GitHub (#48 (comment)).

@joeferner
Copy link

If you need a list of open ports you can use the serialport.list function. I updated the readme over on serialport with an example. On windows it will give you COM1, COM2, etc. On linux/osx it'll give you /dev/ttyUSB0 or whatever.

@rwaldron
Copy link
Owner

Super helpful, thanks!

@ThomasDeutsch
Copy link
Author

You can find this in the serialport code:
https://github.com/voodootikigod/node-serialport/blob/master/bin/serialportList.js

var serialport = require('../');
var sf = require('sf');

serialport.list(function (err, results) {
if (err) {
throw err;
}

for (var i = 0; i < results.length; i++) {
var item = results[i];
console.log(sf('{comName,-15} {pnpId,-20} {manufacturer}', item));
}
});

but i always got an error from serialport.list ?! ... anyone got this working with windows?

@dcherman
Copy link

Yep, just tried serialport.list and it works beautifully. I'll try replacing the detection logic with serialport.list later tonight or tomorrow and see what happens.

@ThomasDeutsch
Copy link
Author

Thank you!

I would like to help People to get the npm install working. Here are the steps it took.

Install:

  • Python 2.7.3 ( http://www.python.org/getit/releases/2.7.3/ )
  • Visual Studio Express 2010 32 bit ( make sure you have the C++ dependencies checked)
  • get node.js ( 32 bit - i never got it working for the x64 .... maybe you need the x64 VS2010 for that)
  • npm install -g node-gyp ( this will install node-gyp globally)

Configuration:

  • set PATH=%PATH%;C:\Python27 ( open cmd und type that in )

run "npm install johnny-five" from the project folder - DONE

i am not sure about the 32-64-bit part. can anyone confirm that?
Here you can set the compiler to 64-bit:
http://msdn.microsoft.com/en-us/library/x4d2c09s(v=vs.80).aspx
but i think you need to have Visual Studio 64 installed?! can anyone confirm?
i could not activate the 64-bit compiler and i have the 32-bit version installed.

@ThomasDeutsch
Copy link
Author

Firmata should work now, too.
Big thanks to jgautier!
firmata/firmata.js#7 (comment)

There was also a problem with node-gyp today..... this was fixed too.
nodejs/node-gyp#122 (comment)

@dcherman
Copy link

I filed a couple new issues related to Windows since this issue is really related to just getting johnny-five installed via npm

#55
#54

I did get a basic blink app running last night though, so that's a good sign

@tehknox
Copy link

tehknox commented Mar 18, 2013

Got it working with :

  • nodejs 0.8.16
  • Python 2.7.3
  • Visual Studio 2010

Going to look further to see what might be the problem with the newer versions of Nodejs.

@Alexaas
Copy link

Alexaas commented Oct 11, 2015

Hi, I have problems installing it on Win 8.1 with VS Express 2015. I get a lot of build errors during installation. Any idea what this could be?
Btw. what is ment by "make sure you have the C++ dependencies checked" ??

@fivdi
Copy link
Contributor

fivdi commented Oct 11, 2015

Hi, I have problems installing it on Win 8.1 with VS Express 2015. I get a lot of build errors during installation. Any idea what this could be?

@Alexaas what version on Node.js is being used? If it's Node.js 4.x, the build errors are likely to be related to serialport which is in the process of being upgraded to support Node.js 4. If this is the case, see serialport/node-serialport#578 for further details.

Btw. what is ment by "make sure you have the C++ dependencies checked" ??

Not sure, but would guess that it meant that a checkbox needed to be checked during the VS2010 install process.

@AlexDmr
Copy link

AlexDmr commented Oct 17, 2015

Same situation with windows 10 and VS Express 2015, NodeJS 4.1.1.
Here are the erros 👍 enumser.cpp
C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport\node_modules\nan\nan.h(263): error
C2995: 'v8::Local _NanEnsureLocal(v8::Local)' : function template has already been defined (..\src\serialport.cpp
) [C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport\build\serialport.vcxproj]
C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport\node_modules\nan\nan.h(25
6) : see declaration of '_NanEnsureLocal'
C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport\node_modules\nan\nan.h(661): error
C3083: 'smalloc': the symbol to the left of a '::' must be a type (..\src\serialport.cpp) [C:\Enseignements\2015\miniSe
rverMM\node_modules\johnny-five\node_modules\serialport\build\serialport.vcxproj]
C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport\node_modules\nan\nan.h(661): error
C2039: 'FreeCallback' : is not a member of 'node' (..\src\serialport.cpp) [C:\Enseignements\2015\miniServerMM\node_modu
les\johnny-five\node_modules\serialport\build\serialport.vcxproj]
C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport\node_modules\nan\nan.h(661): error
C2061: syntax error : identifier 'FreeCallback' (..\src\serialport.cpp) [C:\Enseignements\2015\miniServerMM\node_module
s\johnny-five\node_modules\serialport\build\serialport.vcxproj]
C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport\node_modules\nan\nan.h(665): error
C2065: 'callback' : undeclared identifier (..\src\serialport.cpp) [C:\Enseignements\2015\miniServerMM\node_modules\john
ny-five\node_modules\serialport\build\serialport.vcxproj]
C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport\node_modules\nan\nan.h(665): error
C2065: 'hint' : undeclared identifier (..\src\serialport.cpp) [C:\Enseignements\2015\miniServerMM\node_modules\johnny-f
ive\node_modules\serialport\build\serialport.vcxproj]
C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport\node_modules\nan\nan.h(672): error
C2665: 'node::Buffer::New' : none of the 4 overloads could convert all the argument types (..\src\serialport.cpp) [C:\E
nseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport\build\serialport.vcxproj]
C:\Users\Alexandre.node-gyp\4.1.1\include\node\node_buffer.h(43): could be 'v8::MaybeLocalv8::Object node:
:Buffer::New(v8::Isolate *,char *,size_t)'
C:\Users\Alexandre.node-gyp\4.1.1\include\node\node_buffer.h(31): or 'v8::MaybeLocalv8::Object node:
:Buffer::New(v8::Isolate *,v8::Localv8::String,node::encoding)'
while trying to match the argument list '(v8::Isolate *, const char *, uint32_t)'
C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport\node_modules\nan\nan.h(676): error
C2664: 'v8::Localv8::Object::Local(const v8::Localv8::Object &)' : cannot convert argument 1 from 'v8::MaybeLocal<v
8::Object>' to 'const v8::Localv8::Object &' (..\src\serialport.cpp) [C:\Enseignements\2015\miniServerMM\node_modules
\johnny-five\node_modules\serialport\build\serialport.vcxproj]
Reason: cannot convert from 'v8::MaybeLocalv8::Object' to 'const v8::Localv8::Object'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be cal
led
C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport\node_modules\nan\nan.h(683): error
C2039: 'Use' : is not a member of 'node::Buffer' (..\src\serialport.cpp) [C:\Enseignements\2015\miniServerMM\node_modul
es\johnny-five\node_modules\serialport\build\serialport.vcxproj]
C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport\node_modules\nan\nan.h(683): error
C3861: 'Use': identifier not found (..\src\serialport.cpp) [C:\Enseignements\2015\miniServerMM\node_modules\johnny-five
\node_modules\serialport\build\serialport.vcxproj]
..\src\win\enumser.cpp(443): warning C4996: 'GetVersionExA': was declared deprecated [C:\Enseignements\2015\miniServerM
M\node_modules\johnny-five\node_modules\serialport\build\serialport.vcxproj]
C:\Program Files (x86)\Windows Kits\8.1\Include\um\sysinfoapi.h(433) : see declaration of 'GetVersionExA'
C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport\node_modules\nan\nan.h(263): error
C2995: 'v8::Local _NanEnsureLocal(v8::Local)' : function template has already been defined (..\src\serialport_win
.cpp) [C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport\build\serialport.vcxproj]
C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport\node_modules\nan\nan.h(25
6) : see declaration of 'NanEnsureLocal'
C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport\node_modules\nan\nan.h(661): error
C3083: 'smalloc': the symbol to the left of a '::' must be a type (..\src\serialport_win.cpp) [C:\Enseignements\2015\mi
niServerMM\node_modules\johnny-five\node_modules\serialport\build\serialport.vcxproj]
C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport\node_modules\nan\nan.h(661): error
C2039: 'FreeCallback' : is not a member of 'node' (..\src\serialport_win.cpp) [C:\Enseignements\2015\miniServerMM\node

modules\johnny-five\node_modules\serialport\build\serialport.vcxproj]
C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport\node_modules\nan\nan.h(661): error
C2061: syntax error : identifier 'FreeCallback' (..\src\serialport_win.cpp) [C:\Enseignements\2015\miniServerMM\node_mo
dules\johnny-five\node_modules\serialport\build\serialport.vcxproj]
C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport\node_modules\nan\nan.h(665): error
C2065: 'callback' : undeclared identifier (..\src\serialport_win.cpp) [C:\Enseignements\2015\miniServerMM\node_modules
johnny-five\node_modules\serialport\build\serialport.vcxproj]
C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport\node_modules\nan\nan.h(665): error
C2065: 'hint' : undeclared identifier (..\src\serialport_win.cpp) [C:\Enseignements\2015\miniServerMM\node_modules\john
ny-five\node_modules\serialport\build\serialport.vcxproj]
C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport\node_modules\nan\nan.h(672): error
C2665: 'node::Buffer::New' : none of the 4 overloads could convert all the argument types (..\src\serialport_win.cpp) [
C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport\build\serialport.vcxproj]
C:\Users\Alexandre.node-gyp\4.1.1\include\node\node_buffer.h(43): could be 'v8::MaybeLocalv8::Object node:
:Buffer::New(v8::Isolate *,char *,size_t)'
C:\Users\Alexandre.node-gyp\4.1.1\include\node\node_buffer.h(31): or 'v8::MaybeLocalv8::Object node:
:Buffer::New(v8::Isolate *,v8::Localv8::String,node::encoding)'
while trying to match the argument list '(v8::Isolate *, const char *, uint32_t)'
C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport\node_modules\nan\nan.h(676): error
C2664: 'v8::Localv8::Object::Local(const v8::Localv8::Object &)' : cannot convert argument 1 from 'v8::MaybeLocal<v
8::Object>' to 'const v8::Localv8::Object &' (..\src\serialport_win.cpp) [C:\Enseignements\2015\miniServerMM\node_mod
ules\johnny-five\node_modules\serialport\build\serialport.vcxproj]
Reason: cannot convert from 'v8::MaybeLocalv8::Object' to 'const v8::Localv8::Object'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be cal
led
C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport\node_modules\nan\nan.h(683): error
C2039: 'Use' : is not a member of 'node::Buffer' (..\src\serialport_win.cpp) [C:\Enseignements\2015\miniServerMM\node_m
odules\johnny-five\node_modules\serialport\build\serialport.vcxproj]
C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport\node_modules\nan\nan.h(683): error
C3861: 'Use': identifier not found (..\src\serialport_win.cpp) [C:\Enseignements\2015\miniServerMM\node_modules\johnny-
five\node_modules\serialport\build\serialport.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: C:\Program Files (x86)\MSBuild\12.0\bin\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:2
70:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Windows_NT 10.0.10240
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node
-gyp\bin\node-gyp.js" "build" "--fallback-to-build" "--module=C:\Enseignements\2015\miniServerMM\node_modules\joh
nny-five\node_modules\serialport\build\serialport\v1.7.4\Release\node-v46-win32-x64\serialport.node" "--module_n
ame=serialport" "--module_path=C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialpor
t\build\serialport\v1.7.4\Release\node-v46-win32-x64"
gyp ERR! cwd C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport
gyp ERR! node -v v4.1.1
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'node-gyp.cmd build --fallback-to-build --module=C:\Enseignements\2015
miniServerMM\node_modules\johnny-five\node_modules\serialport\build\serialport\v1.7.4\Release\node-v46-win32-x64\serialp
ort.node --module_name=serialport --module_path=C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules
\serialport\build\serialport\v1.7.4\Release\node-v46-win32-x64' (1)
node-pre-gyp ERR! stack at ChildProcess. (C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\nod
e_modules\serialport\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack at emitTwo (events.js:87:13)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:172:7)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:817:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
node-pre-gyp ERR! System Windows_NT 10.0.10240
node-pre-gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Enseignements\2015\miniServerMM\node_modules\jo
hnny-five\node_modules\serialport\node_modules\node-pre-gyp\bin\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport
node-pre-gyp ERR! node -v v4.1.1
node-pre-gyp ERR! node-pre-gyp -v v0.6.7
node-pre-gyp ERR! not ok
Failed to execute 'node-gyp.cmd build --fallback-to-build --module=C:\Enseignements\2015\miniServerMM\node_modules\johnn
y-five\node_modules\serialport\build\serialport\v1.7.4\Release\node-v46-win32-x64\serialport.node --module_name=serialpo
rt --module_path=C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport\build\serialport\v1
.7.4\Release\node-v46-win32-x64' (1)
npm WARN optional dep failed, continuing serialport@1.7.4

@rwaldron
Copy link
Owner

@AlexDmr Node.js 4.x support is in progress.

@Alexaas
Copy link

Alexaas commented Oct 19, 2015

@rwaldron Could you please give an update here once it should work with Node.js 4.x?

@dtex
Copy link
Collaborator

dtex commented Oct 19, 2015

@rwaldron I propose creating an issue for node 4.x support that details the state of things that we can just point everyone to. Much like @jacobrosenthal did over on the serialport repo. I'm traveling all day, but will write one up tonight.

@playteka
Copy link

playteka commented Dec 9, 2015

@rwaldron , @ThomasDeutsch , @voodootikigod , I think ask people to install visual studio just for installing johnny-five is too heavy. VS is around 10GB. Can you think about light solution like gcc(mingw) on windows?

@rwaldron
Copy link
Owner

rwaldron commented Dec 9, 2015

That hasn't been necessary for almost two years—serialport auto builds pre-compiled binaries for every release

@dtex
Copy link
Collaborator

dtex commented Dec 10, 2015

We need to update the wiki

@vitaliyazvinski
Copy link

@playteka @rwaldron
No need to install whole VS, windows build tools is enough:
npm --add-python-to-path install --global --production windows-build-tools
It will install python and will add it into PATH. It was enough to start blink example.
BTW it works on node v6.11.2 x64

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

No branches or pull requests