How to fix this: The "sys" module is now called "util". It should have a similar interface.

2,619 views
Skip to first unread message

Neelesh Bafna

unread,
Dec 12, 2011, 1:55:41 AM12/12/11
to nod...@googlegroups.com

Using - node v0.6.4
--
Regards
Neelesh Bafna
-Have a great day-

Isaac Schlueter

unread,
Dec 12, 2011, 2:03:28 AM12/12/11
to nod...@googlegroups.com
Replace all calls to `require("sys")` with `require("util")`

> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nod...@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+un...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en

mscdex

unread,
Dec 12, 2011, 2:03:40 AM12/12/11
to nodejs
Replace all instances of `require('sys')` with `require('util')`.

Joshua Kehn

unread,
Dec 12, 2011, 2:11:21 AM12/12/11
to nod...@googlegroups.com
I should write a script that does that for all existing npm modules…

Regards,

–Josh
____________________________________
Joshua Kehn | @joshkehn
http://joshuakehn.com

Neelesh Bafna

unread,
Dec 12, 2011, 2:13:46 AM12/12/11
to nod...@googlegroups.com
Ya got that point, but it requires to check all modules & do it manually...

was just hoping for some automatic fix...

Neelesh Bafna

unread,
Dec 12, 2011, 2:16:24 AM12/12/11
to nod...@googlegroups.com
because in error, it doesn't mention which module is doing require('sys')..

Axel Kittenberger

unread,
Dec 12, 2011, 2:59:51 AM12/12/11
to nod...@googlegroups.com
grep -R "require.*sys" *

Ben Noordhuis

unread,
Dec 12, 2011, 8:03:58 AM12/12/11
to nod...@googlegroups.com
On Mon, Dec 12, 2011 at 08:13, Neelesh Bafna <nba...@syntactice.com> wrote:
> Ya got that point, but it requires to check all modules & do it manually...
>
> was just hoping for some automatic fix...

Semi-automatic:

NODE_DEBUG=sys node script.js

Makes Node print a stack trace that tells you where the sys module is
being included.

Fully automatic, potentially dangerous:

perl -i -pe "s/require('sys')/require('util')/g" $(find . -name \*.js)

Reply all
Reply to author
Forward
0 new messages