GIG

赴くままに技術を。

Angularジェネレータでプロジェクトの生成時にエラー

そろそろ腰を据えて、AngularJSを修得せんと。 angular-seedをcloneして使おうかと思ったけど、最近はYeomanということで、 早速AngularJSのプロジェクトを生成しようとしたら、下記のようなエラーが発生。

> node-gyp rebuild

gyp ERR! configure error
gyp ERR! stack Error: Python executable "python" is v3.3.5, which is not supported by gyp.
gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.
gyp ERR! stack     at failPythonVersion (/Users/hoge/.anyenv/envs/ndenv/versions/v0.10.29/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:108:14)
gyp ERR! stack     at /Users/hoge/.anyenv/envs/ndenv/versions/v0.10.29/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:97:9
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:645:7)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at maybeClose (child_process.js:755:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:822:5)
gyp ERR! System Darwin 14.0.0
gyp ERR! command "node" "/Users/hoge/.anyenv/envs/ndenv/versions/v0.10.29/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/hoge/dev/angular/minimumlist/node_modules/karma/node_modules/chokidar/node_modules/fsevents
gyp ERR! node -v v0.10.29
gyp ERR! node-gyp -v v1.0

node-gypTooTallNate/node-gyp · GitHubPythonの3系に対応してないみたい。 こういうときにXXXenvは便利。プロジェクトを作りたいディレクトリにおりて、2系に切り替えればOK。

$ pyenv local 2.7.6
$ python --version
Python 2.7.6

さて、チュートリアルでもやるか。