node.js download file has cjk name

file download throw error if you have file’s name composed CJK characters
encodeURIComponent

Node.js change function async to sync

Almost Node.js‘s libraries are structured asynchronous.

But some app want to returning synchronous.

Below link maybe help you to change function async to sync.

http://alexeypetrushin.github.io/synchronize/docs/index.html


// change to async to sync
var sync = require('synchronize');
sync.fiber(...);
sync(conn, 'query');// conn means mysql connector here.


// original(async)
conn.query([SOME QUERY], function(err, rows, fields) {
if (err) throw err;
console.log('The solution is: ', rows[0].solution);
});


// new(sync)
try{
var rows = conn.query([SOME QUERY]);
console.log('The solution is: ', rows[0].solution);
}catch (err){
throw err;
}

node fibers Assertion failed! floor_thread_key != 0

Microsoft Visual C++ Runtime Library

Assertion failed!

Program:…e_modulesfibersbinwin32-x64-v8-3.14fibers.node
File: ..srccoroutine.cc
Line: 49

Expression: floor_thread_key != 0

For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts

(Press Retry to debug the application – JIT must be enabled)

solution: remove 64-bit Windows Installer then install 32-bit Windows Installer
http://nodejs.org/download/

npm Error occurs by Visual Studio Build Tool

C:Program Files (x86)MSBuildMicrosoft.Cppv4.0V120Microsoft.Cpp.Platform.t
argets(64,5): error MSB8020: The build tools for Visual Studio 2010 (Platform T
oolset = ‘v100’) cannot be found.

Solution.1
in Enviroment Variables -> User variables
Variable : GYP_MSVS_VERSION
Value : 2013
and reboot cmd

Solution.2
npm install [module_name] –msvs_version=2013