同样是临时维护老项目,执行构建打包命令,例如 npm run build:prod 时报错如下:
ERROR in ./~/css-loader?{"minimize":true,"sourceMap":true}!./~/sass-loader/lib/loader.js?{"sourceMap":true}!./src/styles/index.scss
Module build failed: Error: Node Sass does not yet support your current environment: OS X 64-bit with Unsupported runtime (83)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v4.11.0
at module.exports
......
按道理之前应该是没问题,根据提示可能也是 sass 同当前 node 的环境版本不兼容,当前node 版本为 14.1.0,执行操作:
npm uninstall --save node-sass
cnpm install --save--dev node-sass
搞定!