Q&A

LINE USECASE hairsalonについて

前提・実現したいこと

はじめまして。プログラミング初心者です。 こちらの https://github.com/line/line-api-use-case-reservation-hairsalon をクローンして作業しています。ドキュメントの順番通りに進めていますが、こちらの https://github.com/line/line-api-use-case-reservation-hairsalon/blob/main/docs/jp/front-end-construction.md npm installでエラーが起きてしまいます

発生している問題・エラーメッセージ

発生しているエラーは以下の通りです。

npm ERR! code 127
npm ERR! path /Users/path/front/node_modules/fibers
npm ERR! command failed
npm ERR! command sh -c -- node build.js || nodejs build.js
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@18.13.0 | darwin | arm64
npm ERR! gyp ERR! configure error 
npm ERR! gyp ERR! stack Error: Command failed: /usr/bin/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: invalid syntax
npm ERR! gyp ERR! stack 
npm ERR! gyp ERR! stack     at ChildProcess.exithandler (node:child_process:419:12)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
npm ERR! gyp ERR! stack     at maybeClose (node:internal/child_process:1091:16)
npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:302:5)
npm ERR! gyp ERR! System Darwin 22.2.0
npm ERR! gyp ERR! command "/usr/local/bin/node" "/Users//line-api-use-case-reservation-hairsalon-main-3/front/node_modules/.bin/node-gyp" "rebuild" "--release"
npm ERR! gyp ERR! cwd /Users//line-api-use-case-reservation-hairsalon-main-3/front/node_modules/fibers
npm ERR! gyp ERR! node -v v18.13.0
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok 
npm ERR! node-gyp exited with code: 1
npm ERR! Please make sure you are using a supported platform and node version. If you
npm ERR! would like to compile fibers on this machine please make sure you have setup your
npm ERR! build environment--
npm ERR! Windows + OS X instructions here: https://github.com/nodejs/node-gyp
npm ERR! Ubuntu users please run: `sudo apt-get install g++ build-essential`
npm ERR! RHEL users please run: `yum install gcc-c++` and `yum groupinstall 'Development Tools'` 
npm ERR! Alpine users please run: `sudo apk add python make g++`
npm ERR! sh: nodejs: command not found

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users//.npm/_logs/2023-01-19T01_35_11_811Z-debug-0.log

該当のソースコード

試したこと

調べたところバージョンが適合しないと出てきましたが、なかなか上手く解決できません。 解決策をご教授頂ければ幸いでございます。

補足情報(FW/ツールのバージョンなど)

Python 3.10.9 Node v18.13.0 MacOS 13.1/M1Pro

  • 0
  • 4
  • 327
  • twitter facebook

これで正しいのかはよくわかりませんが、yarn install あるいは npm install --python=python2.7 で解決できそうな気がします。

  • 0

backendの推奨環境がpython3.8以上という意味な気がします。 これはfrontendのビルドに失敗しているのでまた少し違いそうです。 エラーの内容は node-gyp に関連してそうなので、これをキーワードに検索して対処法を探すと良いと思います。

  • 0

kstyさん ご回答ありがとうございます。 こちらのgithub(https://github.com/line/line-api-use-case-reservation-hairsalon) にはPython3.8以上が推奨環境と書いてあるのですが、2をダウンロードした方が良いしょうか?

  • 0

python2のスクリプトをpython3で動かそうとしているので一旦python2を利用できるようにしてみるのがいい気がします。

  • 1

Similar posts

    No similar posts

Are you sure? question.vm