出ているのはPythonのエラーのようです。一部後半割愛していますが
以下のようなエラーとなります。
調べたところこちら にあるように一時的に Python2 にPathを通せば実行できるとの内容でした。出ているエラー的にも2と3の差異であるprint関数の部分が指摘されているので恐らくそんな感じなのかなとも思っていますが、Python2のインストールがうまくいかずその件もこちらで質問している状況になります。
しかしそもそも本当にPython2に変えて動くか定かで無いためnpm installでの以下のエラーから解決策がお分かりになる方いましたらご教示いただけますと助かります。
npm ERR! code 1 npm ERR! path /Users/user/Vue/path/iconv npm ERR! command failed npm ERR! command sh -c -- node-gyp rebuild npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using node-gyp@3.8.0 npm ERR! gyp info using node@16.19.0 | darwin | arm64 npm ERR! gyp ERR! configure error npm ERR! gyp ERR! stack Error: Command failed: /Users/user/.pyenv/shims/python3 -c import sys; print "%s.%s.%s" % sys.version_info[:3]; npm ERR! gyp ERR! stack File "<string>", line 1 npm ERR! gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3]; npm ERR! gyp ERR! stack ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ npm ERR! gyp ERR! stack SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)? npm ERR! gyp ERR! stack npm ERR! gyp ERR! stack at ChildProcess.exithandler (node:child_process:402:12) npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:513:28) npm ERR! gyp ERR! stack at maybeClose (node:internal/child_process:1100:16) npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5) npm ERR! gyp ERR! System Darwin 21.5.0```
python2 はとっくにサポートが切れててますからね…。そもそも何のパッケージのどのバージョンを入れたいのでしょうか? 最新版を入れたら解決するのでは?
node-gyp@3.8.0 という4年半前のバージョンが選択されているのをどうにかするべき(それを質問するべき)。動かなくて当然なレベルの古さ。 https://github.com/nodejs/node-gyp/tree/v3.8.0
node-gypはC++等のNode.jsではないプログラミング言語を
Node.jsに適用するための必殺技みたいなライブラリです。
なんでNode.jsとC++の橋渡しでpython2を要求するんだよとか、
インストールに失敗しまくるみたいな理由でnode-gypはとてつもなく嫌われています。
もし導入しようとしているパッケージがnode-sass(LibSass)ならば、
そのライブラリはサポート対象外の古いライブラリなのでsass(DartSass)へ移行しましょう。
https://buildersbox.corp-sansan.com/entry/2021/03/10/110000
現在Gulpを使っている状態でsass(DartSass)過去の私の回答も参考になるかとおもいます。
https://teratail.com/questions/dcu6xcfm74j326
コメントありがとうございます。間が空いてすみません。
node-sassもそうですが、それ以外もあるようで、node-sassをpackage.jsonから削除しても同様のエラーが出ました。。その場合はどうにかpython2系を入れるしか無いのでしょうか??

あなたの回答
tips
プレビュー