Archive

Posts Tagged ‘install’

Installing Node.js on Mac OsX

Node.js intrigued me and I wanted to hack with Node.js & CouchDB. I read about Node.js and wanted to install it on my Mac. Here is the guide to install Node.js quickly on Os X.

1. If you are running Snow Leopard then the process is simple. Download the latest package from http://sites.google.com/site/nodejsmacosx/ and install it. Done!!

2.If you haven’t upgraded to Snow Leopard and still running on Leopard (like me) then you have made your life miserable. I encountered with a problem in OpenSSL. Apple pushes a very old version of OpenSSL with Leopard. I spent an entire day looking at ways to compile the code to work for Leopard. The errors encountered were as follows:

1. Link error

collect2: ld returned 1 exit status
Waf: Leaving directory `/Users/harsharv/Downloads/nodejs
/node-v0.4.8/build'
Build failed:  -> task failed (err #1): 
	{task: cxx_link node_main_4.o,node_4.o,node_buffer_4.o,
node_javascript_4.o,node_extensions_4.o,node_http_parser_4.o,
node_net_4.o,node_io_watcher_4.o,node_constants_4.o,node_cares_4.o,
node_events_4.o,node_file_4.o,node_signal_watcher_4.o,
node_stat_watcher_4.o,node_timer_4.o,node_script_4.o,
node_os_4.o,node_dtrace_4.o,node_string_4.o,node_stdio_4.o,
node_child_process_4.o,platform_darwin_4.o,node_crypto_4.o,
eio_1.o,http_parser_2.o,ev_1.o,ares_strcasecmp_1.o,ares_free_string_1.o,
ares_options_1.o,ares_send_1.o,ares_parse_txt_reply_1.o,
ares_parse_ptr_reply_1.o,ares_nowarn_1.o,ares_search_1.o,
ares_gethostbyname_1.o,ares_getsock_1.o,ares__timeval_1.o,
inet_ntop_1.o,ares_parse_a_reply_1.o,ares_getopt_1.o,
ares__close_sockets_1.o,ares_expand_string_1.o,
ares_destroy_1.o,ares_cancel_1.o,
ares_parse_aaaa_reply_1.o,ares_parse_ns_reply_1.o,
ares_version_1.o,ares__get_hostent_1.o,ares_writev_1.o,
ares_expand_name_1.o,ares_free_hostent_1.o,
ares_parse_mx_reply_1.o,ares_gethostbyaddr_1.o,
ares_query_1.o,ares_data_1.o,ares_init_1.o,
ares_fds_1.o,inet_net_pton_1.o,ares_strerror_1.o,bitncmp_1.o,
ares_getnameinfo_1.o,ares_library_init_1.o,ares_mkquery_1.o,
ares_process_1.o,windows_port_1.o,ares_parse_srv_reply_1.o,
ares_llist_1.o,ares_timeout_1.o,ares__read_line_1.o,
ares_strdup_1.o -> node}
make: *** [program] Error 1

This problem is solved by upgrading OpenSSL.

2. You have managed to upgrade OpenSSL from 0.97 to 1.* and when you enter the command “node” you get the error

dyld: unknown required load command 0x80000022
Trace/BPT trap

The solution for this was very simple. Compile with out Open SSL 😀
Let me aggregate them. The steps are as follows:

  1. Download the latest source code from http://nodejs.org/#download. Example:http://nodejs.org/dist/node-v0.4.4.tar.gz
  2. tar -xzf node-v0.4.4.tar.gz
  3. cd node-v0.4.4
  4. ./configure –without-ssl
  5. make
  6. make install
  7. cd build/default/node
  8. node
Done

		
Advertisements