0

All,

Likely a noob question, but being brand new to node.js I'm stuck and going in circles so looking for a little prodding in the right direction (my skills are .NET and browser JS).

My first node.js application will read the Windows serial port, so I want to use the voodootikigod / node-serialport module that seems to be the best one to use with node.js on Windows. I have followed the instructions to build it on windows by cloning the github source locally and use node-gyp to configure and build and that works successfully with no errors.

However, I need to install this into a local npm repository so I can 'require' it in my application. I'm using the new Visual Studio Node.js tools for VS (which are an excellent way for a .net developer to get started with node.js) however the included npm package manager can't install from a local folder.

So not knowing much about NPM I am assuming to install this into the local NPM repository with the following command line "npm install" from the local github folder, and it goes pulling all the dependencies but there is an embedded script that runs the following command "node-gyp rebuild" and it is here it falls over with the error: MSB4036 the "VCBuild" task is not found.

I'm using VS 2013 pro, and I thought VCbuild was replaced by MSbuild a while back. So it looks like I have to edit the script that node-gyp rebuild tries to run but I don't know enough about npm and node-gyp to sort this out.

It's likely a dumb newbie problem - can someone point me in the right direction? Thanks.

deandob
  • 5,100
  • 5
  • 25
  • 37
  • I've got VS2010 installed, and don't have any problems. You might have to get someone else to build this for you, or use a module that doesn't require a native module. – Brad Dec 01 '13 at 02:40
  • Thanks Brad. Am I doing the right thing by just running 'npm install' from the source directory and expecting it to work? Sorry for the newbie question – deandob Dec 01 '13 at 03:03
  • Yes, you are. And generally, it should work. Have you tried installing an old copy of Visual Studio Express? I've seen that others are using 2012 with success. – Brad Dec 01 '13 at 03:04
  • Yes, I have VS express installed as well (2013 versions so uses msbuild). What is weird I can execute 'node-gyp rebuild' and it runs fine from the local github folder. It just seems to be the npm install. Is it possible for me to manually copy the files across instead of using npm install? Looking at the module.js code I can see this could work if I copy into a node_modules directory, as I have the files ready in the local github folder – deandob Dec 01 '13 at 03:12
  • What I'm telling you is that your version is too new. Try an older version, like 2012 or 2010. – Brad Dec 01 '13 at 03:13
  • Yes, I needed VS2012. Thanks for the pointer. – deandob Dec 01 '13 at 10:11

1 Answers1

0

Do you have all the requirements in place for node-gyp on Windows (see the readme)? Windows 7 requires Python 2.7 and VS 2010 and Windows 8 requires VS 2012 C++.

jrsconfitto
  • 1,134
  • 1
  • 11
  • 33
  • i've had a lot of trouble with building native modules on my different Windows systems (one box running Win7 and one running Win8.1) and once i got the listed requirements in place, everything worked like a charm. – jrsconfitto Jun 19 '14 at 12:54
  • I use VS2013 and since posting this question node-gyp has been updated to support VS21013 and I have not had problems since. – deandob Jun 19 '14 at 21:02