Node Sass找不到您当前环境的绑定:带有Node.js 12.x的OS X 64位

问题描述

我正在尝试构建Angular项目,但出现此错误

ERROR in Module build Failed (from ./node_modules/sass-loader/lib/loader.js):

Error: Missing binding /XXXXXXX/node_modules/node-sass/vendor/darwin-x64-72/binding.node

Node Sass Could not find a binding for your current environment: OS X 64-bit with Node.js 12.x

解决方法

升级node会拧紧node-sass。要解决:

  • 删除package-lock.json
  • 删除node_modules
npm rebuild node-sass
npm i