LoginSignup
1
3

More than 5 years have passed since last update.

node jsインストール時に SyntaxError: Missing parentheses in call to 'print'

Posted at

node.jsがインストールできない

下記記事を参考にnode.jsをインストールしようとすると、なんかErrorが出てインストールできなかった
node.jsのversionを管理するためにnodebrewを利用する

YourMacBookAir:work KTakata$ nodebrew install v0.12.18
Fetching: https://nodejs.org/dist/v0.12.18/node-v0.12.18.tar.gz
######################################################################## 100.0%
  File "./configure", line 367
    '''
      ^
SyntaxError: Missing parentheses in call to 'print'

SyntaxErrorのエラーメッセージで検索をかけるとpythonのErrorであるっぽい...

そんなわけで、次から躓かないようにインストールできるまでの手順をばまとめる

pythonのバージョンを確認する

YourMacBookAir:~ KTakata$ python -V
Python 3.5.0

3系だった...

Pythonを2系にして再インストールする。(pyenv)

pyenvの使い方はpyenvを使ってMacにPythonの環境を構築するとかを参照

YourMacBookAir:~ KTakata$ pyenv install 2.7.9
Downloading Python-2.7.9.tar.xz...
-> https://www.python.org/ftp/python/2.7.9/Python-2.7.9.tar.xz
Installing Python-2.7.9...
patching file ./Lib/site.py
patching file ./Lib/ssl.py
Installed Python-2.7.9 to /Users/KTakata/.pyenv/versions/2.7.9

YourMacBookAir:~ KTakata$ pyenv global 2.7.9
YourMacBookAir:~ KTakata$ pyenv rehash
YourMacBookAir:~ KTakata$ python -V
Python 2.7.9

再チャレンジ

YourMacBookAir:~ KTakata$ nodebrew install-binary v0.12.18
Fetching: https://nodejs.org/dist/v0.12.18/node-v0.12.18-darwin-x64.tar.gz
######################################################################## 100.0%
Installed successfully
YourMacBookAir:~ KTakata$ nodebrew ls
v0.12.18

current: none
YourMacBookAir:~ KTakata$ nodebrew use v0.12.18
use v0.12.18
YourMacBookAir:~ KTakata$ node -v
v0.12.18

よし、インストールできた。

1
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
3