通過yarn install
安裝依賴包node-sass
時總是報錯,
"../node_modules\node-sass": Command failed. Exit code: 1
具體的錯誤原因為
當(dāng)前使用的node版本與依賴的node-sass版本不匹配,調(diào)整當(dāng)前node版本,建議使用nvm來控制node版本切換
具體對應(yīng)關(guān)系如下:文章來源:http://www.zghlxwxcb.cn/news/detail-756536.html
NodeJS | Supported node-sass version | Node Module |
---|---|---|
Node 19 | 8.0+ | 111 |
Node 18 | 8.0+ | 108 |
Node 17 | 7.0+, <8.0 | 102 |
Node 16 | 6.0+ | 93 |
Node 15 | 5.0+, <7.0 | 88 |
Node 14 | 4.14+ | 83 |
Node 13 | 4.13+, <5.0 | 79 |
Node 12 | 4.12+, <8.0 | 72 |
Node 11 | 4.10+, <5.0 | 67 |
Node 10 | 4.9+, <6.0 | 64 |
Node 8 | 4.5.3+, <5.0 | 57 |
Node <8 | <5.0 | <57 |
解決方法:更改當(dāng)前node版本,或者修改依賴node-sass的版本號即可文章來源地址http://www.zghlxwxcb.cn/news/detail-756536.html
到了這里,關(guān)于node-sass 安裝失敗 Command failed 報錯 node_modules\node-sass: Command failed. Exit code: 1的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!