Can't install npm mailparser

i tried to install mailparser on node v0.8.0 & ubuntu 13.04 but got errors as follows:

sudo npm install mailparser

make[3]: Entering directory /home/iwan/dev/workspace-nodejs/mail-fetcher/node_modules/mailparser/node_modules/iconv/deps/libiconv/srclib' gcc -DHAVE_CONFIG_H -DEXEEXT=\"\" -I. -I.. -I../lib -I../intl -DDEPENDS_ON_LIBICONV=1 -DDEPENDS_ON_LIBINTL=1 -fPIC -c allocator.c gcc -DHAVE_CONFIG_H -DEXEEXT=\"\" -I. -I.. -I../lib -I../intl -DDEPENDS_ON_LIBICONV=1 -DDEPENDS_ON_LIBINTL=1 -fPIC -c areadlink.c gcc -DHAVE_CONFIG_H -DEXEEXT=\"\" -I. -I.. -I../lib -I../intl -DDEPENDS_ON_LIBICONV=1 -DDEPENDS_ON_LIBINTL=1 -fPIC -c careadlinkat.c gcc -DHAVE_CONFIG_H -DEXEEXT=\"\" -I. -I.. -I../lib -I../intl -DDEPENDS_ON_LIBICONV=1 -DDEPENDS_ON_LIBINTL=1 -fPIC -c malloca.c gcc -DHAVE_CONFIG_H -DEXEEXT=\"\" -I. -I.. -I../lib -I../intl -DDEPENDS_ON_LIBICONV=1 -DDEPENDS_ON_LIBINTL=1 -fPIC -c progname.c In file included from progname.c:26:0: ./stdio.h:1010:1: error: ‘gets’ undeclared here (not in a function) make[3]: *** [progname.o] Error 1 make[3]: Leaving directory /home/iwan/dev/workspace-nodejs/mail-fetcher/node_modules/mailparser/node_modules/iconv/deps/libiconv/srclib' make[2]: * [all] Error 2 make[2]: Leaving directory /home/iwan/dev/workspace-nodejs/mail-fetcher/node_modules/mailparser/node_modules/iconv/deps/libiconv/srclib' make[1]: *** [all] Error 2 make[1]: Leaving directory /home/iwan/dev/workspace-nodejs/mail-fetcher/node_modules/mailparser/node_modules/iconv/deps/libiconv' make: * [deps/libiconv/lib/.libs/libiconv.a] Error 2 Traceback (most recent call last): File "/usr/bin/node-waf", line 18, in Scripting.prepare(t, os.getcwd(), VERSION, wafdir) File "/usr/share/nodejs/wafadmin/Scripting.py", line 145, in prepare prepare_impl(t, cwd, ver, wafdir) File "/usr/share/nodejs/wafadmin/Scripting.py", line 135, in prepare_impl main() File "/usr/share/nodejs/wafadmin/Scripting.py", line 188, in main fun(ctx) File "/usr/share/nodejs/wafadmin/Scripting.py", line 386, in build return build_impl(bld) File "/usr/share/nodejs/wafadmin/Scripting.py", line 399, in build_impl bld.add_subdirs([os.path.split(Utils.g_module.root_path)[0]]) File "/usr/share/nodejs/wafadmin/Build.py", line 981, in add_subdirs self.recurse(dirs, 'build') File "/usr/share/nodejs/wafadmin/Utils.py", line 634, in recurse f(self) File "/home/iwan/dev/workspace-nodejs/mail-fetcher/node_modules/mailparser/node_modules/iconv/wscript", line 19, in build make(ctx, 'all') File "/home/iwan/dev/workspace-nodejs/mail-fetcher/node_modules/mailparser/node_modules/iconv/wscript", line 10, in make if os.system(cmd): raise RuntimeError('make %s failed' % rule) RuntimeError: make all failed npm ERR! error installing iconv@1.2.4 npm WARN This failure might be due to the use of legacy binary "node" npm WARN For further explanations, please read npm WARN /usr/share/doc/nodejs/README.Debian npm WARN npm ERR! error installing mailparser@0.3.6

npm ERR! iconv@1.2.4 preinstall: node-waf clean || (exit 0); node-waf configure build npm ERR! sh "-c" "node-waf clean || (exit 0); node-waf configure build" failed with 1 npm ERR! npm ERR! Failed at the iconv@1.2.4 preinstall script. npm ERR! This is most likely a problem with the iconv package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node-waf clean || (exit 0); node-waf configure build npm ERR! You can get their info via: npm ERR! npm owner ls iconv npm ERR! There is likely additional logging output above. npm ERR! npm ERR! System Linux 3.8.0-25-generic npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "mailparser" npm ERR! cwd /home/iwan/dev/workspace-nodejs/mail-fetcher npm ERR! node -v v0.6.19 npm ERR! npm -v 1.1.4 npm ERR! code ELIFECYCLE npm ERR! message iconv@1.2.4 preinstall: node-waf clean || (exit 0); node-waf configure build npm ERR! message sh "-c" "node-waf clean || (exit 0); node-waf configure build" failed with 1 npm ERR! errno {} npm ERR! npm ERR! Additional logging details can be found in: npm ERR!
/home/iwan/dev/workspace-nodejs/mail-fetcher/npm-debug.log npm not ok

I really need this module to parse email body, but can't install it. What is going wrong here?

Thank you.

Try reinstalling node + npm to their latest versions. If that doesn't work, try installing a previous version of mailparser. I tried installing mailparser on my machine and got many warnings but no errors.