Zhongde Liu

This is my personal "Clipboard" of web development stuff I come across


Leave a comment

npm, node-gyp error and Windows

I wanted to try out the Sails framework. On installation (npm install sails) however I just got this error and the installation was unsuccessful.

npm ERR! ws@0.4.32 install: `(node-gyp rebuild 2> builderror.log) || (exit 0)`
npm ERR! spawn ENOENT

It is the same thing as in this closed issue on github. There was a reference to a buggy version of ws/socketIO. Googling some more you get a lot issues related to socketIO and Windows7 or this topic in general. For example:  https://github.com/websockets/ws/issues/240 or http://stackoverflow.com/questions/15200184/why-do-i-get-error-when-trying-to-install-socket-io-with-nmp

In fact as a windows(7) user you may stumbled upon these node-gyp error previously…. nody-gyp is used “for compiling native addon modules for Node.js”. Unfortunately the prerequisites on Windows are Python and Visual Studio!?. Including also several steps for a working setup… https://github.com/TooTallNate/node-gyp/wiki/Visual-Studio-2010-Setup.

I thought  “What the …”. I just wanted to try something out.

End of story: I used “–force” on the install command and it worked. But for how long and what actually happened or did not happen behind the installation curtain!? I hope node-gyp, or the related modules (ws) will get updates to fix these hurdles on windows machines…

 

Update: As of now Sails(0.11.0) and socketIO(1.3.5) are installing just fine on windows…

Advertisements


Leave a comment

Build tools: Grunt – gulp – npm run

Grunt (http://gruntjs.com/) is the de facto standard regarding (frontend) build tools.

But there are alternatives.

Especially gulp (http://gulpjs.com/) is getting a bit of a momentum. gulp has a more “coding” mentality in contrast to the configuration heavy grunt setup.  It already has all the essential plugins (jshint, uglify, sass, less, etc…) for a sophisticated build workflow. In my opinion the coding style within the gulpfile offers  more readability than the big configuration objects  in gruntfiles.

Another way is to (“mis-“)use the “npm run” command to run scripts/commands, which are noted in the “scripts” field within the package.json file. James Halliday wrote a nice blog post about it: http://substack.net/task_automation_with_npm_run.

Of course there are the classical ways to perform a build: make, ant, rake, etc…


Leave a comment

How-to: Proxy setting for “Github for Windows”

For setting the proxy you need to edit a file named .gitconfig. This file should be located in your user folder, C:\Users\[xxxxx]\.gitconfig with [xxxxx] being your windows username.

In this file you need to add following lines, adapted to your proxy:

[http] 
proxy = http://proxy.example.com:8080 

[https] 
proxy = http://proxy.example.com:8080


2 Comments

How-To: npm behind a proxy

When you want to use npm (http://npmjs.org/), package manager for node, behind a proxy, pay attention that there are two parameters for setting up a proxy:

  1. proxy
  2. https-proxy

As https is the default protocol for fetching the packages from the npm repository you must set the second one.

Another workaround is to change the rep url into a http one.


Leave a comment

Installing is nomally so easy….

…but not always. I tried to install die Kinect SDK and stumbled upon different problems – with just executing the .exe install file:

  1. Install process just brakes with no error message….
  2. ……Finding the setup-log
    • Hit “set TEMP” into the command shell prints your temp folder of your current user
    • Analysing the log points me to “Error 0x800b010e” — …great
  3. After some research on the web I disabled some security settings in advanced options tab of the internet options
  4. ….it is installing a bit longer – but still – error
  5. …. Analysing (again) the log reveals “Error”0x80096005” — great²
  6. Hey there is a magical command found in a post of one of microsofts forum which solves this problem!
    Make sure your machine has cached the certificate revocation list (CRL) for the timestamp countersignature.  You can force this to happen by running the following commands:
    certutil -URLCache -f http://crl.microsoft.com/pki/crl/products/MicrosoftTimeStampPCA.crl 
  7. Viola! – It is installed