1鹅搪、更新了node站绪,原本node v8.x 更新后 node v10.x,啟動原來的項(xiàng)目丽柿,報(bào)錯(cuò)如下:
Module build failed: Error: Missing binding G:\myCode\YB\clientapps\AccountV4\node_modules_node-sass@4.9.0@node-sass\vendor\win32-x64-64\binding.node
Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 10.x
Found bindings for the following environments:
Windows 64-bit with Node.js 8.x
解決辦法:需要重裝node-sass包
npm rebuild node-sass
安裝完重新啟動就ok了恢准, 所以沒事還是別更新node魂挂,最好保持團(tuán)隊(duì)的環(huán)境一致~
npm update
2、node-sass 5.0和4.0不相容馁筐,需要安裝4.0問題
Module build failed: Error: Node Sass version 5.0.0 is incompatible with ^4.0.0.
此錯(cuò)誤來自sass-loader.因?yàn)閚ode-sass@latest為v5.0.0,而sass-loader期望值為^4.0.0
解決辦法:將node-sass安裝回4.0版本
//卸載 node-sass
npm uninstall node-sass
//然后安裝最新版本(5.0之前)
npm install node-sass@4.14.1
3涂召、Error error0308010Cdigital envelope routinesunsupported
原因是版本不兼容引起的,執(zhí)行以下命令即可
set NODE_OPTIONS=--openssl-legacy-provider