Closed chauthai closed 8 years ago
I've found a polyfill for process.stdout
:
https://github.com/kumavis/browser-stdout
I may just extend it to support process.stderr
too.
I've managed to build a polyfill for process.stderr:
https://gist.github.com/chauthai/cb6108b95c3b98bff175
I'm now encountering a problem with fs.existsSync
:
Looks like fs.existsSync
has a dependency on the process.binding
function and is not that easily polyfillable.
I assume you are not using jspm here? Are you running this in Node and not the browser at all?
If so you can just set up a node core mapping like:
System.config({
map: {
'assert': '@node/assert',
'buffer': '@node/buffer',
'child_process': '@node/child_process',
'cluster': '@node/cluster',
'console': '@node/console',
'constants': '@node/constants',
'crypto': '@node/crypto',
'dgram': '@node/dgram',
'dns': '@node/dns',
'domain': '@node/domain',
'events': '@node/events',
'fs': '@node/fs',
'http': '@node/http',
'https': '@node/https',
'module': '@node/module',
'net': '@node/net',
'os': '@node/os',
'path': '@node/path',
'process': '@node/process',
'punycode': '@node/punycode',
'querystring': '@node/querystring',
'readline': '@node/readline',
'repl': '@node/repl',
'stream': '@node/stream',
'string_decoder': '@node/string_decoder',
'sys': '@node/sys',
'timers': '@node/timers',
'tls': '@node/tls',
'tty': '@node/tty',
'url': '@node/url',
'util': '@node/util',
'vm': '@node/vm',
'zlib': '@node/zlib'
}
});
If you are running the in the browser, then you need the polyfills though.
Hi,
I'm using jspm and run it in the browser. I've stopped investigating because of the process.binding
dependency which leads into a node.js platform specific C implementation.
Right, yes it doesn't sound like this package will browserify easily.
any solution for the "ansi" problem, so far.
Regards,
I'm trying to use knex.js to connect to a local SQLite database in a cordova app using system.js. To connect to the database knex.js uses websql wrapper which depends on the sqlite3 package. mapbox/node-sqlite3/issues/512 So far the error points to ansi function of ansi.js.
Stack trace screenshot:
![screen shot 2015-11-27 at 14 10 35](https://cloud.githubusercontent.com/assets/5654065/11441889/b12fc40a-9510-11e5-8ca1-56279a843906.png)
It seems
stream
is undefined in the system.js enviroment. I've found a similar issue pointing to an error in browserify TooTallNate/ansi.js#21:process.stderr not being defined is a result of browserify
Also this issue in
npmlog
npm/npmlog#14 points to the core of the problem: The missing polyfill to export stdout and stderr in node-process. Any chances for a workingnode-process
polyfill?