JavaScript

node.js

Lionの下準備

  1. xcodeのinstall
    appstoreから
  2. macportsのinstall
    http://www.macports.org/install.php

node.js

dekuyou-no-MacBook-Air:~ dekuyou$ sudo port selfupdate
Warning: xcodebuild exists but failed to execute
--->  Updating MacPorts base sources using rsync
MacPorts base version 2.0.4 installed,
MacPorts base version 2.0.4 downloaded.
--->  Updating the ports tree
--->  MacPorts base is already the latest version

The ports tree has been updated. To upgrade your installed ports, you should run
  port upgrade outdated

あれ?

dekuyou-no-MacBook-Air:~ dekuyou$ sudo port install nodejs
Password:
Warning: xcodebuild exists but failed to execute
Warning: Xcode appears to be installed but xcodebuild is unusable; some ports will likely fail to build.
Warning: You may need to run `sudo xcode-select -switch /Applications/Xcode.app`
Warning: The Command Line Tools for Xcode don't appear to be installed; most ports will likely fail to build.
Warning: See http://guide.macports.org/chunked/installing.xcode.html for more information.
--->  Computing dependencies for nodejsError: Unable to execute port: can't read "build.cmd": Failed to locate 'make' in path: '/opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin' or at its MacPorts configuration time location, did you move it?
To report a bug, see <http://guide.macports.org/#project.tickets>

https://developer.apple.com/downloads/index.action?name=for%20Xcode%20-#

から、Command Line Tools for Xcode を入れる

dekuyou-no-MacBook-Air:~ dekuyou$ sudo port install nodejs
Password:
Warning: xcodebuild exists but failed to execute
Warning: Xcode appears to be installed but xcodebuild is unusable; some ports will likely fail to build.
Warning: You may need to run `sudo xcode-select -switch /Applications/Xcode.app`
--->  Computing dependencies for nodejs
--->  Dependencies to be installed: openssl zlib pkgconfig glib2 gettext expat libiconv gperf ncurses ncursesw libffi perl5 perl5.12 gdbm xz python27 bzip2 db46 libedit python_select sqlite3
--->  Fetching archive for zlib
--->  Attempting to fetch zlib-1.2.6_0.darwin_11.x86_64.tbz2 from http://packages.macports.org/zlib
--->  Fetching zlib
--->  Attempting to fetch zlib-1.2.6.tar.bz2 from http://distfiles.macports.org/zlib
--->  Verifying checksum(s) for zlib
--->  Extracting zlib
Error: Couldn't determine your Xcode version (from '/usr/bin/xcodebuild -version').
Error: 
Error: If you have not installed Xcode, install it now; see:
Error: http://guide.macports.org/chunked/installing.xcode.html
Error: 
Error: Target org.macports.extract returned: unable to find Xcode
Error: Failed to install zlib
Log for zlib is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_zlib/zlib/main.log
Error: The following dependencies were not installed: openssl zlib pkgconfig glib2 gettext expat libiconv gperf ncurses ncursesw libffi perl5 perl5.12 gdbm xz python27 bzip2 db46 libedit python_select sqlite3
Error: Status 1 encountered during processing.
To report a bug, see <http://guide.macports.org/#project.tickets>
dekuyou-no-MacBook-Air:~ dekuyou$ 

なんでかな。。。。

dekuyou-no-MacBook-Air:~ dekuyou$ xcode-select -print-path
xcode-select: Error: No Xcode folder is set. Run xcode-select -switch <xcode_folder_path> to set the path to the Xcode folder.
dekuyou-no-MacBook-Air:~ dekuyou$ 

Path通った。。。

dekuyou-no-MacBook-Air:~ dekuyou$ sudo port installed
No ports are installed.
dekuyou-no-MacBook-Air:~ dekuyou$ xcode-select -print-path/Applications/Xcode.app/Contents/Developer
dekuyou-no-MacBook-Air:~ dekuyou$ 

node.js install できた。

dekuyou-no-MacBook-Air:~ dekuyou$ sudo port install nodejs
--->  Computing dependencies for nodejs
--->  Dependencies to be installed: openssl zlib pkgconfig glib2 gettext expat libiconv gperf ncurses ncursesw libffi perl5 perl5.12 gdbm xz python27 bzip2 db46 libedit python_select sqlite3
--->  Extracting zlib
--->  Applying patches to zlib
--->  Configuring zlib
--->  Building zlib
--->  Staging zlib into destroot
--->  Installing zlib @1.2.6_0
--->  Activating zlib @1.2.6_0
--->  Cleaning zlib
--->  Fetching archive for openssl
--->  Attempting to fetch openssl-1.0.1_1.darwin_11.x86_64.tbz2 from http://packages.macports.org/openssl
--->  Fetching openssl
--->  Attempting to fetch openssl-1.0.1.tar.gz from http://distfiles.macports.org/openssl
--->  Verifying checksum(s) for openssl
--->  Extracting openssl
--->  Applying patches to openssl
--->  Configuring openssl
--->  Building openssl
--->  Staging openssl into destroot
--->  Installing openssl @1.0.1_1
--->  Activating openssl @1.0.1_1
--->  Cleaning openssl
--->  Fetching archive for expat
--->  Attempting to fetch expat-2.0.1_1.darwin_11.x86_64.tbz2 from http://packages.macports.org/expat
--->  Fetching expat
--->  Attempting to fetch expat-2.0.1.tar.gz from http://jaist.dl.sourceforge.net/project/expat/expat/2.0.1
--->  Verifying checksum(s) for expat
--->  Extracting expat
--->  Configuring expat
--->  Building expat
--->  Staging expat into destroot
--->  Installing expat @2.0.1_1
--->  Activating expat @2.0.1_1
--->  Cleaning expat
--->  Fetching archive for gperf
--->  Attempting to fetch gperf-3.0.4_2.darwin_11.x86_64.tbz2 from http://packages.macports.org/gperf
--->  Fetching gperf
--->  Attempting to fetch gperf-3.0.4.tar.gz from ftp://ftp.dti.ad.jp/pub/GNU/gperf
--->  Verifying checksum(s) for gperf
--->  Extracting gperf
--->  Applying patches to gperf
--->  Configuring gperf
--->  Building gperf
--->  Staging gperf into destroot
--->  Installing gperf @3.0.4_2
--->  Activating gperf @3.0.4_2
--->  Cleaning gperf
--->  Fetching archive for libiconv
--->  Attempting to fetch libiconv-1.14_0.darwin_11.x86_64.tbz2 from http://packages.macports.org/libiconv
--->  Fetching libiconv
--->  Attempting to fetch libiconv-1.14.tar.gz from ftp://ftp.dti.ad.jp/pub/GNU/libiconv
--->  Attempting to fetch libiconv-1.14.tar.gz from http://mirror.facebook.net/gnu/gnu/libiconv
--->  Attempting to fetch libiconv-1.14.tar.gz from http://distfiles.macports.org/libiconv
--->  Verifying checksum(s) for libiconv
--->  Extracting libiconv
--->  Applying patches to libiconv
--->  Configuring libiconv
--->  Building libiconv
--->  Staging libiconv into destroot
--->  Installing libiconv @1.14_0
--->  Activating libiconv @1.14_0
--->  Cleaning libiconv
--->  Fetching archive for ncursesw
--->  Attempting to fetch ncursesw-5.8_0.darwin_11.noarch.tbz2 from http://packages.macports.org/ncursesw
--->  Fetching ncursesw
--->  Verifying checksum(s) for ncursesw
--->  Extracting ncursesw
--->  Configuring ncursesw
--->  Building ncursesw
--->  Staging ncursesw into destroot
--->  Installing ncursesw @5.8_0
--->  Activating ncursesw @5.8_0
--->  Cleaning ncursesw
--->  Fetching archive for ncurses
--->  Attempting to fetch ncurses-5.9_1.darwin_11.x86_64.tbz2 from http://packages.macports.org/ncurses
--->  Fetching ncurses
--->  Attempting to fetch ncurses-5.9.tar.gz from ftp://ftp.dti.ad.jp/pub/GNU/ncurses
--->  Attempting to fetch ncurses-5.9.tar.gz from http://mirror.facebook.net/gnu/gnu/ncurses
--->  Attempting to fetch ncurses-5.9.tar.gz from http://distfiles.macports.org/ncurses
--->  Verifying checksum(s) for ncurses
--->  Extracting ncurses
--->  Applying patches to ncurses
--->  Configuring ncurses
--->  Building ncurses
--->  Staging ncurses into destroot
--->  Installing ncurses @5.9_1
--->  Activating ncurses @5.9_1
--->  Cleaning ncurses
--->  Fetching archive for gettext
--->  Attempting to fetch gettext-0.18.1.1_2.darwin_11.x86_64.tbz2 from http://packages.macports.org/gettext
--->  Fetching gettext
--->  Attempting to fetch gettext-0.18.1.1.tar.gz from ftp://ftp.dti.ad.jp/pub/GNU/gettext
--->  Verifying checksum(s) for gettext
--->  Extracting gettext
--->  Applying patches to gettext
--->  Configuring gettext
--->  Building gettext
--->  Staging gettext into destroot
--->  Installing gettext @0.18.1.1_2
--->  Activating gettext @0.18.1.1_2
--->  Cleaning gettext
--->  Fetching archive for libffi
--->  Attempting to fetch libffi-3.0.10_2.darwin_11.x86_64.tbz2 from http://packages.macports.org/libffi
--->  Fetching libffi
--->  Attempting to fetch libffi-3.0.10.tar.gz from http://distfiles.macports.org/libffi
--->  Verifying checksum(s) for libffi
--->  Extracting libffi
--->  Applying patches to libffi
--->  Configuring libffi
--->  Building libffi
--->  Staging libffi into destroot
--->  Installing libffi @3.0.10_2
--->  Activating libffi @3.0.10_2
--->  Cleaning libffi
--->  Fetching archive for gdbm
--->  Attempting to fetch gdbm-1.10_1.darwin_11.x86_64.tbz2 from http://packages.macports.org/gdbm
--->  Fetching gdbm
--->  Attempting to fetch gdbm-1.10.tar.gz from ftp://ftp.dti.ad.jp/pub/GNU/gdbm
--->  Attempting to fetch gdbm-1.10.tar.gz from http://mirror.facebook.net/gnu/gnu/gdbm
--->  Attempting to fetch gdbm-1.10.tar.gz from http://distfiles.macports.org/gdbm
--->  Verifying checksum(s) for gdbm
--->  Extracting gdbm
--->  Configuring gdbm
--->  Building gdbm
--->  Staging gdbm into destroot
--->  Installing gdbm @1.10_1
--->  Activating gdbm @1.10_1
--->  Cleaning gdbm
--->  Fetching archive for perl5.12
--->  Attempting to fetch perl5.12-5.12.3_3.darwin_11.x86_64.tbz2 from http://packages.macports.org/perl5.12
--->  Fetching perl5.12
--->  Attempting to fetch perl-5.12.3.tar.bz2 from http://distfiles.macports.org/perl5.12
--->  Verifying checksum(s) for perl5.12
--->  Extracting perl5.12
--->  Applying patches to perl5.12
--->  Configuring perl5.12
--->  Building perl5.12
--->  Staging perl5.12 into destroot
--->  Installing perl5.12 @5.12.3_3
--->  Activating perl5.12 @5.12.3_3
--->  Cleaning perl5.12
--->  Fetching archive for perl5
--->  Attempting to fetch perl5-5.12.3_1+perl5_12.darwin_11.noarch.tbz2 from http://packages.macports.org/perl5
--->  Fetching perl5
--->  Verifying checksum(s) for perl5
--->  Extracting perl5
--->  Configuring perl5
--->  Building perl5
--->  Staging perl5 into destroot
--->  Installing perl5 @5.12.3_1+perl5_12
--->  Activating perl5 @5.12.3_1+perl5_12
--->  Cleaning perl5
--->  Fetching archive for xz
--->  Attempting to fetch xz-5.0.3_0.darwin_11.x86_64.tbz2 from http://packages.macports.org/xz
--->  Fetching xz
--->  Attempting to fetch xz-5.0.3.tar.bz2 from http://distfiles.macports.org/xz
--->  Verifying checksum(s) for xz
--->  Extracting xz
--->  Configuring xz
--->  Building xz
--->  Staging xz into destroot
--->  Installing xz @5.0.3_0
--->  Activating xz @5.0.3_0
--->  Cleaning xz
--->  Fetching archive for glib2
--->  Attempting to fetch glib2-2.30.3_0.darwin_11.x86_64.tbz2 from http://packages.macports.org/glib2
--->  Fetching glib2
--->  Attempting to fetch glib-2.30.3.tar.xz from http://ftp.nara.wide.ad.jp/pub/X11/GNOME/sources/glib/2.30/
--->  Verifying checksum(s) for glib2
--->  Extracting glib2
--->  Applying patches to glib2
--->  Configuring glib2
--->  Building glib2
--->  Staging glib2 into destroot
--->  Installing glib2 @2.30.3_0
--->  Activating glib2 @2.30.3_0
--->  Cleaning glib2
--->  Fetching archive for pkgconfig
--->  Attempting to fetch pkgconfig-0.26_1.darwin_11.x86_64.tbz2 from http://packages.macports.org/pkgconfig
--->  Fetching pkgconfig
--->  Attempting to fetch pkg-config-0.26.tar.gz from http://distfiles.macports.org/pkgconfig
--->  Verifying checksum(s) for pkgconfig
--->  Extracting pkgconfig
--->  Configuring pkgconfig
--->  Building pkgconfig
--->  Staging pkgconfig into destroot
--->  Installing pkgconfig @0.26_1
--->  Activating pkgconfig @0.26_1
--->  Cleaning pkgconfig
--->  Fetching archive for bzip2
--->  Attempting to fetch bzip2-1.0.6_0.darwin_11.x86_64.tbz2 from http://packages.macports.org/bzip2
--->  Fetching bzip2
--->  Attempting to fetch bzip2-1.0.6.tar.gz from http://distfiles.macports.org/bzip2
--->  Verifying checksum(s) for bzip2
--->  Extracting bzip2
--->  Applying patches to bzip2
--->  Configuring bzip2
--->  Building bzip2
--->  Staging bzip2 into destroot
--->  Installing bzip2 @1.0.6_0
--->  Activating bzip2 @1.0.6_0
--->  Cleaning bzip2
--->  Fetching archive for db46
--->  Attempting to fetch db46-4.6.21_6.darwin_11.x86_64.tbz2 from http://packages.macports.org/db46
--->  Fetching db46
--->  Attempting to fetch patch.4.6.21.1 from http://distfiles.macports.org/db4/4.6.21_6
--->  Attempting to fetch patch.4.6.21.2 from http://distfiles.macports.org/db4/4.6.21_6
--->  Attempting to fetch patch.4.6.21.3 from http://distfiles.macports.org/db4/4.6.21_6
--->  Attempting to fetch patch.4.6.21.4 from http://distfiles.macports.org/db4/4.6.21_6
--->  Attempting to fetch db-4.6.21.tar.gz from http://distfiles.macports.org/db4/4.6.21_6
--->  Verifying checksum(s) for db46
--->  Extracting db46
--->  Applying patches to db46
--->  Configuring db46
--->  Building db46
--->  Staging db46 into destroot
--->  Installing db46 @4.6.21_6
--->  Activating db46 @4.6.21_6
--->  Cleaning db46
--->  Fetching archive for libedit
--->  Attempting to fetch libedit-20110802-3.0_0.darwin_11.x86_64.tbz2 from http://packages.macports.org/libedit
--->  Fetching libedit
--->  Attempting to fetch libedit-20110802-3.0.tar.gz from http://distfiles.macports.org/libedit
--->  Verifying checksum(s) for libedit
--->  Extracting libedit
--->  Applying patches to libedit
--->  Configuring libedit
--->  Building libedit
--->  Staging libedit into destroot
--->  Installing libedit @20110802-3.0_0
--->  Activating libedit @20110802-3.0_0
--->  Cleaning libedit
--->  Fetching archive for python_select
--->  Attempting to fetch python_select-0.3_1.darwin_11.noarch.tbz2 from http://packages.macports.org/python_select
--->  Fetching python_select
--->  Verifying checksum(s) for python_select
--->  Extracting python_select
--->  Configuring python_select
--->  Building python_select
--->  Staging python_select into destroot
--->  Installing python_select @0.3_1
--->  Activating python_select @0.3_1
--->  Cleaning python_select
--->  Fetching archive for sqlite3
--->  Attempting to fetch sqlite3-3.7.11_0.darwin_11.x86_64.tbz2 from http://packages.macports.org/sqlite3
--->  Fetching sqlite3
--->  Attempting to fetch sqlite-autoconf-3071100.tar.gz from http://distfiles.macports.org/sqlite3
--->  Verifying checksum(s) for sqlite3
--->  Extracting sqlite3
--->  Applying patches to sqlite3
--->  Configuring sqlite3
--->  Building sqlite3
--->  Staging sqlite3 into destroot
--->  Installing sqlite3 @3.7.11_0
--->  Activating sqlite3 @3.7.11_0
--->  Cleaning sqlite3
--->  Fetching archive for python27
--->  Attempting to fetch python27-2.7.2_4.darwin_11.x86_64.tbz2 from http://packages.macports.org/python27
--->  Fetching python27
--->  Attempting to fetch Python-2.7.2.tar.bz2 from http://distfiles.macports.org/python27
--->  Verifying checksum(s) for python27
--->  Extracting python27
--->  Applying patches to python27
--->  Configuring python27
--->  Building python27
--->  Staging python27 into destroot
--->  Installing python27 @2.7.2_4
--->  Activating python27 @2.7.2_4

To make python 2.7 the default (i.e. the version you get when you run
'python'), please run:
    	sudo port select --set python python27

--->  Cleaning python27
--->  Fetching archive for nodejs
--->  Attempting to fetch nodejs-0.6.14_0+python27+ssl.darwin_11.x86_64.tbz2 from http://packages.macports.org/nodejs
--->  Fetching nodejs
--->  Attempting to fetch node-v0.6.14.tar.gz from http://distfiles.macports.org/nodejs
--->  Verifying checksum(s) for nodejs
--->  Extracting nodejs
--->  Configuring nodejs
--->  Building nodejs
--->  Staging nodejs into destroot
--->  Installing nodejs @0.6.14_0+python27+ssl
--->  Activating nodejs @0.6.14_0+python27+ssl
--->  Cleaning nodejs

動作確認

dekuyou-no-MacBook-Air:~ dekuyou$ node
> console.log("hello world.");
hello world.
undefined
> .exit
dekuyou-no-MacBook-Air:~ dekuyou$ 

動いた。OK。

eclipse

Eclipse IDE for JavaScript Web Developers | Eclipse Packages

plug-in

heroku

node.js websocket が利用できる? http://www.heroku.com/


トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2017-04-07 (金) 16:01:32 (228d)