Le solution:

DON't use .exec
Use .spawn

The function is bad, it's design is bad, it's behaviour is unpredictable, it can be replaced by .spawn, there is no fucking excuse for anyone to ever use it.

If you do like:

proc = child_process.exec(...genius code...)
proc.stdout.pipe(gloryhole)

It continues to flood its internal buffer even if you do not provide any callback where the buffer is meant to be used.
This function is fucking nuts!

Keep calm and 200KB is enough for everyone.

[ ]
 

куе-уе

var queue = function({max_concurrency = 1} = {})
{
    var queue = []
    var pending = 0
    var iterate_queue = function()
    {
        if((queue.length > 0) && (pending < max_concurrency))
        {
            pending++
            var item = queue.shift()
            item.fn(item.done)
        }
    }
    var interface = 
    {
        add: function(fn)
        {
            return new Promise(function(resolve,reject)
            {
                queue.push(
                {
                    fn: fn,
                    done: function(error,result)
                    {
                        pending--
                        setTimeout(iterate_queue)
                        if(error) 
                        { 
                            reject(error)
                        }
                        else
                        {
                            resolve(result)
                        }
                    }
                })
                iterate_queue()
            })
        }
    }
    return interface
}
[ ]
 
# apt-cache show node
N: Can't select versions from package 'node' as it is purely virtual
N: No packages found

# apt-cache show nodejs
Package: nodejs
Priority: extra
Section: universe/web
Installed-Size: 12930
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Debian Javascript Maintainers <pkg-javascript-devel@lists.alioth.debian.org>
Architecture: amd64
Version: 4.2.6~dfsg-1ubuntu4.1
Provides: nodejs-abi-46
Depends: libc6 (>= 2.15), libgcc1 (>= 1:3.4), libicu55 (>= 55.1-1~), libssl1.0.0 (>= 1.0.2~beta3), libstdc++6 (>= 5.2), libuv1 (>= 1.6.1), zlib1g (>= 1:1.1.4)
Filename: pool/universe/n/nodejs/nodejs_4.2.6~dfsg-1ubuntu4.1_amd64.deb
Size: 3161040
MD5sum: 7213fe0f524db1488167850252e769a5
SHA1: 3ed9c0b3586c76c9006bc0d9c1575a30d2ba1edf
SHA256: 831033c58c40879af924ac820c8f6295889f2ef8df90ebe41079e0af272390a9
Description-en: evented I/O for V8 javascript
 Node.js is a platform built on Chrome's JavaScript runtime for easily
 building fast, scalable network applications. Node.js uses an
 event-driven, non-blocking I/O model that makes it lightweight and
 efficient, perfect for data-intensive real-time applications that run
 across distributed devices.
 .
 Node.js is bundled with several useful libraries to handle server
 tasks:
 .
 System, Events, Standard I/O, Modules, Timers, Child Processes, POSIX,
 HTTP, Multipart Parsing, TCP, DNS, Assert, Path, URL, Query Strings.
Description-md5: e507fb472d7cdaceffc5b285a62d5c1b
Homepage: http://nodejs.org/
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu

Package: nodejs
Priority: extra
Section: universe/web
Installed-Size: 12930
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Debian Javascript Maintainers <pkg-javascript-devel@lists.alioth.debian.org>
Architecture: amd64
Version: 4.2.6~dfsg-1ubuntu4
Provides: nodejs-abi-46
Depends: libc6 (>= 2.15), libgcc1 (>= 1:3.4), libicu55 (>= 55.1-1~), libssl1.0.0 (>= 1.0.2~beta3), libstdc++6 (>= 5.2), libuv1 (>= 1.6.1), zlib1g (>= 1:1.1.4)
Filename: pool/universe/n/nodejs/nodejs_4.2.6~dfsg-1ubuntu4_amd64.deb
Size: 3161636
MD5sum: 4b20acbf1f01cb13661ce50eb7b62c1d
SHA1: cd2b863329d135f3c32b54b22a0c52e765355a1d
SHA256: b8b6a9d9dafa004a8574a7d4eed987a8ee175059fb0946ebb81c21780b19503b
Description-en: evented I/O for V8 javascript
 Node.js is a platform built on Chrome's JavaScript runtime for easily
 building fast, scalable network applications. Node.js uses an
 event-driven, non-blocking I/O model that makes it lightweight and
 efficient, perfect for data-intensive real-time applications that run
 across distributed devices.
 .
 Node.js is bundled with several useful libraries to handle server
 tasks:
 .
 System, Events, Standard I/O, Modules, Timers, Child Processes, POSIX,
 HTTP, Multipart Parsing, TCP, DNS, Assert, Path, URL, Query Strings.
Description-md5: e507fb472d7cdaceffc5b285a62d5c1b
Homepage: http://nodejs.org/
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu

[ ]
 

Нужно её ЗАКОДИРОВАТЬ. И тогда она, блядь, раскодируется.

iconv = require 'iconv-lite'
fileName = '%D0%90%D0%BA%D1%82%D1%83%D0%B0%D0%BB%D1%8C%D0%BD%D1%8B%D0%B9%20%D0%BF%D1%80%D0%B0%D0%B9%D1%8111.08.15.xls'
fileName = unescape(fileName)
console.log fileName
fileName = iconv.encode(fileName,'iso8859-1')
console.log fileName.toString()

Причина ошибки:
Вялотекущая шизофрения.
Как починить:
Вызывать методы без аргументов, используя вместо параметра null и только null.

soap = require 'soap'
soap.createClient(
  'https://api.schizophrenia.gov', 
  (err, client) ->
    client.setSecurity(new soap.BasicAuthSecurity('login','password'))
    client.GetBrokenNeuronsList(
      null
      ,
      (err, result) ->
        console.log(result)
    )
)
[ ]
 

N"OWw RIWWITNHK AAAAAARR DER PROTOROPYTEP PORPERTY>111..
Unfolded:

events = require "events"

instances_counter = 0
module.exports = (
  -> 
    __class = (-> 
      __args = Array.prototype.slice.call(arguments)
      if @ instanceof __class
        @constructor?.apply(@,__args) if __class isnt @constructor;@
      else 
        new (Function.prototype.bind.apply(__class,[null].concat(__args)))
    );
    __class.prototype = if @prototype? then Object.create(@prototype.prototype) else @;
    __class.prototype[__prop] = @[__prop] for __prop of @ if @prototype?;
    __class).apply

  prototype: events.EventEmitter

  constructor: (@param1,@param2) ->
    @prototype.apply @
    @id = ++instances_counter

  render: ->
    console.log @,instances_counter,@ instanceof module.exports

a = new module.exports()
a.render()
b = new module.exports()
b.render()
console.log a instanceof events.EventEmitter
console.log a instanceof module.exports

Folded:

events = require "events"

instances_counter = 0
module.exports = (-> __class = (-> __args = Array.prototype.slice.call(arguments); if @ instanceof __class then @constructor?.apply(@,__args) if __class isnt @constructor;@ else new (Function.prototype.bind.apply(__class,[null].concat(__args)))); __class.prototype = (if @prototype? then Object.create(@prototype.prototype) else @); (__class.prototype[__prop] = @[__prop] for __prop of @ if @prototype?); __class).apply

  prototype: events.EventEmitter

  constructor: (@param1,@param2) ->
    @prototype.apply @
    @id = ++instances_counter

  render: ->
    console.log @,instances_counter,@ instanceof module.exports

a = new module.exports()
a.render()
b = new module.exports()
b.render()
console.log a instanceof events.EventEmitter
console.log a instanceof module.exports
[ ]
 

Кавычечки. Кавычечки. Вместо одинарных случайно поставил двойные, автозаменой. Кавычечки он не любит. Пиздец.

Было:

#!/bin/bash
###
NODE_VERSION=">=0.11.13"
if [ -z $(which node) ]; then echo "ERROR: NODE.JS NOT FOUND"; exit 1; fi
if [ -z $(which coffee) ]; then echo "ERROR: COFFEESCRIPT NOT FOUND"; exit 1; fi
if [ "$(node -p "require('semver').satisfies(process.version,'$NODE_VERSION')")" != "true" ]; then echo "ERROR: INCOMPATIBLE NODE VERSION"; exit 1; fi
echo "Starting Coffee"; node --harmony $(which coffee) "$0" -- "$@"
exit
###
console.log "pizdos..."
console.log process.argv

Стало:

#!/bin/bash
###
NODE_VERSION=\>=0.11.13
if [ -z $(which node) ]; then echo ERROR: NODE.JS NOT FOUND; exit 1; fi
if [ -z $(which coffee) ]; then echo ERROR: COFFEESCRIPT NOT FOUND; exit 1; fi
if [ $(node -p require\(\'semver\'\).satisfies\(process.version,\'$NODE_VERSION\'\)) != true ]; then echo ERROR: INCOMPATIBLE NODE VERSION; exit 1; fi
echo Starting Coffee; node --harmony $(which coffee) $0 -- $@
exit
###
console.log "pizdos..."
console.log process.argv

ТЕПЕРЬ БОЛЬШЕ НИКАКИХ вложенных КАВЫЧЕЧЕК БЛЯДЬ! КОКАЯ КРОСОТА! МОЖНО ТЕПЕРЬ И ПОРАБОТАТЬ, НО ЧТО-ТО НЕ ХОЧЕТСЯ.
А вот ну совсем-совсем без кавычечек:

#!/bin/bash
###
NODE_VERSION=\>=0.11.13
if [ -z $(which node) ]; then echo ERROR: NODE.JS NOT FOUND; exit 1; fi
if [ -z $(which coffee) ]; then echo ERROR: COFFEESCRIPT NOT FOUND; exit 1; fi
if [ $(node -p require\(String\(/semver/\).substring\(1,7\)\).satisfies\(process.version,String\(/$NODE_VERSION/\).substring\(1\).slice\(0,-1\)\)) != true ]; then echo ERROR: INCOMPATIBLE NODE VERSION; exit 1; fi
echo Starting Coffee; node --harmony $(which coffee) $0 -- $@
exit
###
console.log "pizdos..."
console.log process.argv

МЕНЬШЕ КАВЫЧЕК БОБУ НЕКАВЫЧКИНУ

[ ]
 

Симптомы:

{ [Error: SQLITE_BUSY: database is locked] errno: 5, code: 'SQLITE_BUSY' }

Лечение:

db().configure("busyTimeout", 60000)
[ ]
 
npm list co
[ ]
 

Симптомы:
При npm install sqlite3 вывавливается

node-pre-gyp install --fallback-to-build

Лечение:

apt-get install make g++
[ ]