'make: *** [Release/obj.target/binding/src/binding.o] Error 1 when using dart sass

Because the node-sass was no longer maintain and did no compatiable with the higher version of node, so I tried to change the node-sass to dart-sass, when I use the dart-sass in the vue project like this:

"sass": "1.48.0",

shows error:

npm ERR! /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:710:50: note: 'remove_cv' declared here
npm ERR! template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_cv
npm ERR!                                                  ^
npm ERR! 1 error generated.
npm ERR! make: *** [Release/obj.target/binding/src/binding.o] Error 1
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack     at ChildProcess.onExit (/Users/xiaoqiangjiang/source/reddwarf/frontend/crx-selection-translate/node_modules/node-gyp/lib/build.js:262:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:390:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! gyp ERR! System Darwin 21.1.0
npm ERR! gyp ERR! command "/Users/xiaoqiangjiang/.nvm/versions/node/v16.13.2/bin/node" "/Users/xiaoqiangjiang/source/reddwarf/frontend/crx-selection-translate/node_modules/.bin/node-gyp" "rebuild"
npm ERR! gyp ERR! cwd /Users/xiaoqiangjiang/source/reddwarf/frontend/crx-selection-translate/node_modules/node-sass
npm ERR! gyp ERR! node -v v16.13.2
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/xiaoqiangjiang/.npm/_logs/2022-01-15T11_36_53_164Z-debug.log

why did this happen? what should I do fix this problem? This is my project package.json:

{
  "private": true,
  "repository": {
    "type": "git",
    "url": "git+https://github.com/jiangxiaoqiang/crx-selection-translate.git"
  },
  "scripts": {
    "xpostinstall": "node ./build/install-pdf-viewer",
    "dev": "webpack --config build/webpack.dev.config.js",
    "build": "gulp --cwd . --gulpfile build/gulp-build.js",
    "test": "karma start build/karma.config.js"
  },
  "dependencies": {
    "bootstrap-sass": "^3.4.1",
    "chrome-call": "^1.0.2",
    "connect.io": "^3.1.3",
    "interact.js": "^1.2.6",
    "js-wheel": "git+https://github.com/jiangxiaoqiang/js-wheel.git",
    "translation.js": "git+https://github.com/jiangxiaoqiang/translation.js.git",
    "vue": "^1.0.24",
    "vue-router": "^0.7.11"
  },
  "devDependencies": {
    "babel-core": "^6.26.3",
    "babel-loader": "^6.2.4",
    "babel-plugin-transform-runtime": "^6.9.0",
    "babel-polyfill": "^6.9.1",
    "babel-preset-es2015": "^6.9.0",
    "babel-preset-stage-3": "^6.5.0",
    "chrome-env": "^0.0.6",
    "css-loader": "^0.23.1",
    "del": "^2.2.0",
    "download": "^5.0.0",
    "extract-text-webpack-plugin": "^1.0.1",
    "file-loader": "^0.8.5",
    "fs-extra": "^8.1.0",
    "gulp": "^3.9.1",
    "gulp-clean-css": "^2.3.2",
    "gulp-htmlmin": "^2.0.0",
    "gulp-jsonmin": "^1.2.0",
    "gulp-uglify": "^1.5.3",
    "gulp-zip": "^3.2.0",
    "isparta-loader": "^2.0.0",
    "jasmine-core": "^2.99.1",
    "karma": "^0.13.22",
    "karma-chrome-launcher": "^1.0.1",
    "karma-coverage": "^1.1.2",
    "karma-coveralls": "^1.2.1",
    "karma-firefox-launcher": "^1.3.0",
    "karma-ie-launcher": "^1.0.0",
    "karma-jasmine": "^1.1.2",
    "karma-phantomjs-launcher": "^1.0.0",
    "karma-safari-launcher": "^1.0.0",
    "karma-sourcemap-loader": "^0.3.8",
    "karma-webpack": "^1.7.0",
    "phantomjs-prebuilt": "^2.1.6",
    "raw-loader": "^0.5.1",
    "sass": "1.48.0",
    "sass-loader": "^3.2.0",
    "style-loader": "^0.13.0",
    "vue-html-loader": "^1.2.0",
    "webpack": "^1.13.1"
  },
  "author": "Jiangxiaoqiang <[email protected]>",
  "license": "GPLv3",
  "bugs": {
    "url": "https://github.com/jiangxiaoqiang/crx-selection-translate/issues"
  },
  "homepage": "https://github.com/jiangxiaoqiang/crx-selection-translate#readme"
}

the node version is 16 and the os was macOS moteney with M1 chip.



Solution 1:[1]

I had the same issue on my Mac M1. In my case, sass and node versions were not matching. I had to downgrade node from 16.x to 12.x. I guess, if that is possible upgrading sass should also work, but I never did that.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 jaw