LoginSignup
1
1

More than 1 year has passed since last update.

M1,2(arm64)でnode-sassを使用するには

Posted at

はじめに

最近、intel macからM2 macに変更したのですが、環境構築等を行っているときにnode-sassに関してのエラーが発生し、解決に時間がかかったので備忘録として残しておきます。

エラー内容

プロジェクトをyarn install した際に以下のエラーが発生しました。

.../node_modules/node-sass: Command failed.
Exit code: 1
Command: node scripts/build.js
Arguments:  ...
Directory:  ...
...
gyp info using node-gyp@3.8.0
gyp info using node@14.17.0 | darwin | arm64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2
...
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` failed Error: not found: python
...

試したこと

・ node-sassのバージョンが4.14.1だっためそれに対応するnodeをインストールする(私の場合はv14.17.0)
・ エラー内容に書かれている通り、python2がないですよ!と言われているのでinstall

以上の二つを行うことでエラーは解決した。

参考

・ node-sass document

・ node.jsインストール手順

・ pythonインストール手順

1
1
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
1