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.

SSL certificate problem, verify that the CA cert is OK

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

これは、はまりました。
FuelPHPにて、httpsプロトコルAPIをcURL経由で実行しようとした時に遭遇。
localサーバでも問題なかったが、リモートサーバ(Windows 2008 Server with オレオレSSL証明書)にあげた途端このエラー。

ということで、googleったら、以下のリンクにて対応策が。よし!

The Secret to cURL in PHP on Windows

んが、ダメ。で行き着いたのが以下の対応。とりあえず、社内イントラツールなので、セキュリティ的に大丈夫ということで。助かりました。。

SSL通信時発生する証明書エラーとその仕組みを理解する
[PHP][cURL] cURLでSSL(https)のCA証明書警告の回避や設定

FuelPHPにて、コードは以下。今回は、Mandrill APIを利用しての送信。

Thanks :)

How to use “grunt-react” #2
Collaboration with grunt-browserify

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

Browserify enables CommonJS syntax where module importing is available.

This post is an additional version of the previous “How to use “grunt-react” Auto translation from jsx to js“. The “grunt-react” plugin can be more useful & effective with Browserify. And a plugin called “grunt-browserify” is the great contributor!

Install

If you did not install “grunt-react”, please refer to the previous post here.

Grunt configuration

A value in options “tranform: transform: [ require('grunt-react').browserify ]” imports grunt-react config.

JS

Only with grunt-react

For grunt-react config, please refer to the previous post.

Obviously, we need to read react.js prior to the above js file, otherwise the script fails to run.

With Browserify

Here employs react.js from bower (bower install react). You don’t need react.js line in html anymore!

How to use “grunt-react”
Auto translation from jsx to js

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

React.js allows jsx scripting along with one of those translation tools like “JSXTransformer.js”.The “grunt-react” automates the conversion so that you only read a converted js file in your page.

Without grunt-react

HTML

JS

With grunt-react

We don’t need JSXTransformer.js anymore because grunt-react converts “jsx/main.jsx” (totally same contents as “main.js” above) to “js/main.js” of normal JS format. So only you need to do is to read react.js itself and the main.js.

HTML

Grunt config