問題
「Error: error:0308010C:digital envelope routines::unsupported」というエラー発生してビルドができない。
環境
Mac OS
原因
Node.jsの新しいバージョンにしたことで、パッケージやライブラリとの互換性に問題が生じたため。
解決方法
nvmが入っていない場合はインストール
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
nvm --version
ここで
「-bash: nvm: command not found」というエラーが返ってきた場合は
source ~/.nvm/nvm.sh
上記のコマンドを実行。
その後、改めてお好きなバージョンのnvmをインストール
nvm install 12.0.0
nvm use 12.0.0
再度ビルドを行なって確認
npm run build
npm run serve