5

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.

2
  • same issue. Found solution? Commented Jan 28, 2022 at 13:06
  • try to upgrade the sass loader version.@ДанилаНиконец 9.x + version support dart sass.
    – Dolphin
    Commented Jan 28, 2022 at 13:16

3 Answers 3

5

Not sure if this is the same issue but I was able to fix the installation by using the following commands:

rm -rf node_modules
rm yarn.lock
yarn install -std=c++17

Found the answer with an explanation here

Additional troubleshooting I ran into that unrelated to this exact question:

If unable to load external module @babel/register make sure that both babel-core and babel-register are installed as well as the gulp-cli: yarn global add gulp-cli.

If using node-sass and receiving the following error:

Error: Node Sass does not yet support your current environment: OS X Unsupported architecture (arm64) with Unsupported runtime (108)

remove node-sass and use dart-sass:

npm uninstall gulp-sass
npm uninstall gulp-sass-lint
npm i gulp-dart-sass
1
  • 1
    Oh wow, yarn install -std=c++17 did the trick on my Mac M1
    – ckhatton
    Commented Apr 5, 2023 at 17:35
2

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.

1
  • This was my problem. Was using too new of a version of node. 12 was the right one... Commented Mar 24, 2023 at 21:34
1

Command Line DartSass for Mac m1

First of all install the missing packages at https://brew.sh/ Copy this:/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" After: npm i -d sass

after a careful research it seems that m1 is missing many packages to make dart sass work for this reason everything that is missing must be installed with the line written above.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.