jashkenas/coffee-script — Issue #1782: Problem with require.paths, again
Author: Izikiel
Created: 2011-10-20 02:53:41+00:00
State: open

Hello, I'm having the same problem with node 0.5.10 and CS 1.1.2, i tried downgrading to 1.1.1, but the problem is still the same.
I'm doing some exercises from "CoffeeScript (accelerated javascript development)" and when I try to do coffee first_iteration.coffee this error arises

```
coffee first_iteration.coffee

Welcome to 5X5!
Please enter the coordinates for the first tile

/usr/local/lib/node_modules/coffee-script/lib/command.js:15
return process.binding('stdio').writeError(line + '\n');
^
Error: No such module
at /usr/local/lib/node_modules/coffee-script/lib/command.js:15:20
at /usr/local/lib/node_modules/coffee-script/lib/command.js:167:7
at /usr/local/lib/node_modules/coffee-script/lib/command.js:115:26
at [object Object]. (fs.js:108:5)
at [object Object].emit (events.js:64:17)
at afterRead (fs.js:1074:12)
at Object.wrapper [as oncomplete] (fs.js:246:17)
```

In the code i use stdin = process.openStdin() to interact with the user.

The funny thing is that if I open the coffee REPL and type process, the error above appears, if I type process again, it works just fine, any ideas why?

```

coffee> process
Error: require.paths is removed. Use node_modules folders, or the NODE_PATH environment variable instead.
at Function. (module.js:376:11)
at Object.eval (/usr/local/lib/node_modules/coffee-script/lib/coffee-script.js:97:32)
at Interface. (/usr/local/lib/node_modules/coffee-script/lib/repl.js:44:34)
at Interface.emit (events.js:67:17)
at Interface._onLine (readline.js:162:10)
at Interface._line (readline.js:426:8)
at Interface._ttyWrite (readline.js:603:14)
at ReadStream. (readline.js:82:12)
at ReadStream.emit (events.js:88:20)
at ReadStream._emitKey (tty.js:309:10)

coffee> process
{ EventEmitter: [Function: EventEmitter],
title: 'node',
version: 'v0.5.10-pre',
assert: [Function],
_tickCallback: [Function],
moduleLoadList:
[ 'Binding evals',
'Binding natives',
'NativeModule events',
'NativeModule buffer',
'Binding buffer',
'NativeModule assert',
'NativeModule util',
'NativeModule path',
'NativeModule module',
'NativeModule fs',
'Binding fs',
'Binding constants',
'NativeModule stream',
'NativeModule child_process',
'NativeModule net',
'NativeModule timers',
'Binding timer_wrap',
'NativeModule _linklist',
'Binding process_wrap',
'NativeModule readline',
'NativeModule tty',
'Binding tty_wrap',
'NativeModule vm',
'NativeModule console',
'Binding signal_watcher' ],
nextTick: [Function],
versions:
{ node: '0.5.10-pre',
v8: '3.6.4',
ares: '1.7.5-DEV',
uv: '0.1',
openssl: '0.9.8l' },
arch: 'x64',
stdout: [Getter],
stderr: [Getter],
platform: 'darwin',
stdin: [Getter],
argv: [ 'node', '/usr/local/bin/coffee' ],
env:
{ TERM_PROGRAM: 'Apple_Terminal',
TERM: 'xterm-color',
SHELL: '/bin/bash',
TMPDIR: '/var/folders/4g/4gD4VAUkFTOkZrBTB8HbPk+++TI/-Tmp-/',
Apple_PubSub_Socket_Render: '/tmp/launch-jS1bAM/Render',
TERM_PROGRAM_VERSION: '273.1',
OLDPWD: '/Users/ezequieldariogambaccini',
USER: 'ezequieldariogambaccini',
COMMAND_MODE: 'unix2003',
SSH_AUTH_SOCK: '/tmp/launch-M8WqO0/Listeners',
__CF_USER_TEXT_ENCODING: '0x1F5:0:0',
PATH: '/usr/bin/coffee:/usr/local/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/X11/bin',
PWD: '/Users/ezequieldariogambaccini/Documents/CoffeScript/5x5_book_game',
NODE_PATH: '/usr/local/lib/node_modules',
SHLVL: '1',
HOME: '/Users/ezequieldariogambaccini',
PYTHONPATH: '/Users/ezequieldariogambaccini/Documents/python:/Users/ezequieldariogambaccini/Documents/python',
LOGNAME: 'ezequieldariogambaccini',
LC_CTYPE: 'UTF-8',
DISPLAY: '/tmp/launch-t38oRG/org.macosforge.xquartz:0',
_: '/usr/local/bin/coffee' },
openStdin: [Function],
exit: [Function],
pid: 1529,
features:
{ debug: false,
uv: true,
ipv6: true,
tls_npn: false,
tls_sni: true,
tls: true },
kill: [Function],
addListener: [Function],
execPath: '/usr/local/bin/node',
compile: [Function],
on: [Function],
removeListener: [Function],
_needTickCallback: [Function],
reallyExit: [Function],
debug: [Function],
error: [Function],
chdir: [Function],
cwd: [Function],
watchFile: [Function],
writeError: [Function],
unwatchFile: [Function],
umask: [Function],
mixin: [Function],
getuid: [Function],
createChildProcess: [Function],
setuid: [Function],
inherits: [Function],
_byteLength: [Function],
setgid: [Function],
mainModule:
{ id: '.',
exports: {},
parent: null,
filename: '/usr/local/lib/node_modules/coffee-script/bin/coffee',
loaded: true,
exited: false,
children: [],
paths:
[ '/usr/local/lib/node_modules/coffee-script/bin/node_modules',
'/usr/local/lib/node_modules/coffee-script/node_modules',
'/usr/local/lib/node_modules',
'/usr/local/node_modules',
'/usr/node_modules',
'/node_modules' ] },
getgid: [Function],
dlopen: [Function],
_events:
{ uncaughtException: [Function],
SIGWINCH: [ [Function] ] },
_kill: [Function],
uptime: [Function],
memoryUsage: [Function],
uvCounters: [Function],
binding: [Function] }
coffee>
```