0
0

yarn install --check-filesをしたらnode-sassが読み込まれないエラー

Posted at

自分用備忘録として作成
(初心者のため、もし違っていたら教えていただけると幸いです。)

課題でクローンしたアプリケーションを立ち上げるためにyarn install --check-filesをしたら、
error /Users/yec2016/workspace/dpro/rails_refactoring_task/node_modules/node-sass: Command failed.とエラーが出た。

環境は、
mac
node -v 18.18.0
node-sass -v 4.14.1
yarn -v 1.22.22

解決方法としては、node-sassのバージョンに対応できるnodeバージョンまで下げる。(pythonが読み込めないというエラーもあったため、pythonをインストールしたが、意味がなかった。)

#node-sassのバージョン確認
npm list node-sass
football_info_for_refactoring@0.1.0 /Users/xxx/workspace/xxx/rails_refactoring_task
└─┬ @rails/webpacker@4.3.0
└── node-sass@4.14.1

node-sass 4.14.1ではnodeのバージョンは13までということなので、

#nvmで13.10.1をインストール
nvm install 13.10.1 

#nodeのバージョンを13.10.1で固定する
nvm use v13.10.1

#node -vで確認
node -v v13.10.1
再度 yarn install --check-files で無事できました!
(nodeのバージョンを下げたので、error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.とありました。node-sassを上げてもいいのかもしれないですが、クローンしたバージョンを変えたくなかったので、このままにしておく。)

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