Tutorial: Local Cloud on Windows [25 July 2014]

Hi @Dave
It seems h5.coap did get put in the protocol module with npm install ../../h5.coap
The following command npm install, however, failed with the same error (git not found).

Any ideas? Thanks so much for your help.

Hi @rahilj,

Any luck here? Iā€™m thinking maybe the easiest fix is to try and make sure your Git / Node.js install is working properly, and then maybe try a normal install? Sorry I donā€™t have a better answer!

Thanks,
David

Hi @rahilj,

I had similar problem as yours . It took me entire day to figure out the solution.
Mostly this could be happening because of the MS Windows framework mismatches.

git not found is only a subsequent problem that occurs if the required other dependencies arenā€™t fulfilled like SDK, Build, openssl etc.

when you get the git not found error I hope you must be getting the main highlighted error on top.

If that is the case, I would suggest you to remove the older versions of VS C++ distributions or any SDKs you have already installed and follow this :

On Windows:
Windows XP/Vista/7:
Microsoft Visual Studio C++ 2010 (Express version works well)
For 64-bit builds of node and native modules you will also need the Windows 7 64-bit SDK
If the install fails, try uninstalling any C++ 2010 x64&x86 Redistributable that you have installed first.
If you get errors that the 64-bit compilers are not installed you may also need the compiler update for the Windows SDK 7.1
Windows 7/8:
Microsoft Visual Studio C++ 2012 for Windows Desktop (Express version works well)

Please use Node.js x86 and openssl x86 versions.
I had problems using x64 versions.
Also, once you are set with above installations, make sure you have set PATH right for openssl.

Use nodejs command prompt and avoid using others like cmd or git bash. (git bash should be used for cloning purpose)

Once you are set just change you directory to ā€¦/spark-server/js and hit npm install
The npm manager will take care of all the required node packages and will include them in your server package.

If everything goes well, hit node main.js and you are all set.

thanks,
Akash

Thanks Akash for such a detailed reply. I will try your method once I have some downtime. Will keep you posted. Thanks a lot!

Hello @kennethlimcp,

I got to the end of the tutorial but had two things go a little differently than expected.

When I ran the npm install at the very end I got a prompt saying:
npm WARN package.json spark-server@0.1.1 no description
npm WARN package.json spark-server@0.1.1 no README data

and the second was after I ran node main.js at the end. It gave me an extra line after my IP address saying:
Caught exception: Error: listen EADDRINUSE{ā€œcodeā€:ā€œEADDRINUSEā€,ā€œerrnoā€:ā€œEADDRINU
SEā€,ā€œsyscallā€:ā€œlistenā€}

What are your thoughts? Havenā€™t been able to find anything out about them really

Regards,
Nick

Seems like some other application is using port 8080 thatā€™s why. you might have to trace it down. haha!

In terms of the first issue though, do you think itā€™s an issue?

EDIT:

rather, do you think it will cause problems?

not at all. thatā€™s simply because the package.json (recalling off my head) did not contain those metadata and npm is giving a warning thatā€™s all :wink:

1 Like

A note about the python install, I had trouble with 2.7.5, but switching to 2.7.3 fixed the issue.

1 Like

I crushed like, every single web service on ports higher than 5000 and its still giving me the same error. Doing a netstat in CMD even tells me port 8080 is the node.exe and before it said it was an unknown process (it was some NI manager in the background). Other thoughts?

EDIT

I think something is using port 5683 but I can't figure it out for the life of me

You can change the port to other than 8080 but 5683 shouldnā€™t be used.

Can you restart your machine and try again?

Success, although getting Ursa to build was a bit of a bear (yuk yuk). Visual Studio 2008 didnā€™t cut it, so I installed 2010 Express. I now have 3 versions of Visual Studio.
My question now is with my core on the local cloud. I see references to OTA flash updates but I canā€™t find how this is accomplished. ā€œSpark Devā€ doesnā€™t seem to know about thisā€¦is it even possible?

Looks like the CLI on Local Cloud wasnā€™t working - this is Windows, and moving everything to the ā€˜Cā€™ drive helped. I had most of these new tools on my ā€˜Dā€™ drive.

Not sure what you meant by not working but my setup has been working great with Spark-cli :wink:

Spark-CLI would only work with USB-connected commands. It couldnā€™t seem to do anything with my local server even though my core was happy with the server. Maybe it was just the process of re-installing Spark-CLI (albeit on another drive) that fixed it.
Anyway, local ā€œspark flashā€ commands now work. The main reason for running a local cloud is because our corporate firewall blocks the CoAP port, even though our IT folks tried to open that port.

Did you try TCP 5683? Spark.variable, Spark.functions and Spark.publish works fine for me on local :cloud: and they are all non-USB functions.

You might want to try it out! :wink:

Hi there, iā€™m i doing something wrong? Hereā€™s my npm install log

D:\spark\spark-server\js>npm install
npm WARN package.json spark-server@0.1.1 No description
npm WARN package.json spark-server@0.1.1 No README data
|


> ursa@0.8.1 install D:\spark\spark-server\js\node_modules\ursa
> node-gyp configure && node-gyp build && node install.js

/
D:\spark\spark-server\js\node_modules\ursa>node "C:\Program Files (x86)\nodejs\n
ode_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" c
onfigure
gyp ERR! configure error
gyp ERR! stack Error: spawn ENOENT
gyp ERR! stack     at errnoException (child_process.js:1011:11)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:802:
34)
gyp ERR! System Windows_NT 6.2.9200
gyp ERR! command "node" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\nod
e_modules\\node-gyp\\bin\\node-gyp.js" "configure"
gyp ERR! cwd D:\spark\spark-server\js\node_modules\ursa
gyp ERR! node -v v0.10.35
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok
npm ERR! ursa@0.8.1 install: `node-gyp configure && node-gyp build && node insta
ll.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ursa@0.8.1 install script.
npm ERR! This is most likely a problem with the ursa package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp configure && node-gyp build && node install.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls ursa
npm ERR! There is likely additional logging output above.

npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program File
s (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! cwd D:\spark\spark-server\js
npm ERR! node -v v0.10.35
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0

@axel, is this installed? http://go.microsoft.com/?linkid=9709949

Yes, i got Visual C++ 2010 installed up to date and registered

Iā€™m on windows 8.1 x64 with node x86, pyhon 2.7.9 x86 and OpenSSL Vsersion x86 1.0.1h 5 jun 2014

My npm is working fine and i have no clue of whatā€™s wrong right now

I noticed that in the ursa page it saids that in windows 8 ursa requires visual studio 2012 (Iā€™ll try that in the meantime)
https://www.npmjs.com/package/ursa

1 Like

Let me know how it goes.

When i wrote this and @peekay123 tested it, the Windows environment is 7.

Iā€™m on Mac OS unless thereā€™s a need for me to switch over to for some windows-specific application.

If that works fine i will update the instructions for future reader. Or i will spin up a Windows 8/8.1 OS and install from scratch if you are still having difficulties :wink: