Failed at the node-sass@0.9.6 install script ‘node build.js’.

Tweet about this on TwitterShare on FacebookShare on LinkedInShare on Google+

When installing a set of gulp plugins through npm, I got an error saying..

Only you need to do is to downgrade your node version.
Let’s say you have the version 5.5.0.

nodebrew

Install nodebrew.

Add the following to ~/.bashrc

Refresh console

Install and switch to older version.

Try again. Should work now.

How to figure out browser “touchevent” by JavaScript

Tweet about this on TwitterShare on FacebookShare on LinkedInShare on Google+

Touch event check

Including Windows 8

Figuring out pointer type

For IE10 or later version on Win 8, it is sometimes required to figure out what pointer is used.
For example, suppose you have a menu list where each menu item has children items with a slider container.
The children container appears in mouse hovering and touch, where mouse click makes the page go to the link.
The touch events trigger “click” event as well which means touch event takes care of hovering and clicking action.
We need to prevent touch event from linking to another page.

Grunt: grunt-contrib-connect for remote livereload

Tweet about this on TwitterShare on FacebookShare on LinkedInShare on Google+

A Grunt plugin “grunt-contrib-conenct” provides you live reloading along with your file modification.

Conventional configuration

Sometimes you need it available from remote console in case where we need to check on different browsers or share the page to other engineers. To realize it, you need a bit extra configuration because initially the plugin blocks remote http access.

Well, it accepts only localhost access.

Solution

Just add the hostname option as below.

Done!

Grunt: grunt-requirejs with almond.js

Tweet about this on TwitterShare on FacebookShare on LinkedInShare on Google+

A grunt plugin “grunt-requirejs” offers almond.js which is compact version of require.js. (without async function)
If you unify all of js modules configured with require.js, asynchronous process by require.js is not necessary.
In that case, activate almond.js!

Install grunt-requirejs

Run this on the project folder.

Configuration

Directory

grunt-requirejs configuration

For parameter settings, please refer to here.

almond Activate almond or not
mainConfigFile File path for require configuration
baseUrl Base url for js files
name Main JavaScript file path without .js extention
* Relative path to “baseUrl”
out Output file path
optimize Optimising format
uglify | uglify2 | closure | closure.keepLines | none
preserveLicenseComments Whether keep licence comments or not