0

This is happening to me after a git rebase.

The following error shows up after:

  1. running yarn upgrade having a yarn.lock file
  2. Also executing yarn install after deleting yarn.lock
  3. when trying to add a new package, with yarn add
2 warnings generated.
  c++ '-DNODE_GYP_MODULE_NAME=libsass' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DLIBSASS_VERSION="3.5.5"' -I/Users/samuelgarciacompanys/.node-gyp/16.13.2/include/node -I/Users/samuelgarciacompanys/.node-gyp/16.13.2/src -I/Users/samuelgarciacompanys/.node-gyp/16.13.2/deps/openssl/config -I/Users/samuelgarciacompanys/.node-gyp/16.13.2/deps/openssl/openssl/include -I/Users/samuelgarciacompanys/.node-gyp/16.13.2/deps/uv/include -I/Users/samuelgarciacompanys/.node-gyp/16.13.2/deps/zlib -I/Users/samuelgarciacompanys/.node-gyp/16.13.2/deps/v8/include -I../src/libsass/include  -O3 -gdwarf-2 -mmacosx-version-min=10.7 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=c++11 -stdlib=libc++ -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/sass2scss.o.d.raw   -c -o Release/obj.target/libsass/src/libsass/src/sass2scss.o ../src/libsass/src/sass2scss.cpp
  c++ '-DNODE_GYP_MODULE_NAME=libsass' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DLIBSASS_VERSION="3.5.5"' -I/Users/samuelgarciacompanys/.node-gyp/16.13.2/include/node -I/Users/samuelgarciacompanys/.node-gyp/16.13.2/src -I/Users/samuelgarciacompanys/.node-gyp/16.13.2/deps/openssl/config -I/Users/samuelgarciacompanys/.node-gyp/16.13.2/deps/openssl/openssl/include -I/Users/samuelgarciacompanys/.node-gyp/16.13.2/deps/uv/include -I/Users/samuelgarciacompanys/.node-gyp/16.13.2/deps/zlib -I/Users/samuelgarciacompanys/.node-gyp/16.13.2/deps/v8/include -I../src/libsass/include  -O3 -gdwarf-2 -mmacosx-version-min=10.7 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=c++11 -stdlib=libc++ -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/sass_context.o.d.raw   -c -o Release/obj.target/libsass/src/libsass/src/sass_context.o ../src/libsass/src/sass_context.cpp
In file included from ../src/libsass/src/sass_context.cpp:9:
../src/libsass/src/ast.hpp:1614:25: warning: loop variable 'numerator' creates a copy from type 'const std::__1::basic_string<char>' [-Wrange-loop-construct]
        for (const auto numerator : numerators)
                        ^
../src/libsass/src/ast.hpp:1614:14: note: use reference type 'const std::__1::basic_string<char> &' to prevent copying
        for (const auto numerator : numerators)
             ^~~~~~~~~~~~~~~~~~~~~~
                        &
../src/libsass/src/ast.hpp:1616:25: warning: loop variable 'denominator' creates a copy from type 'const std::__1::basic_string<char>' [-Wrange-loop-construct]
        for (const auto denominator : denominators)
                        ^
../src/libsass/src/ast.hpp:1616:14: note: use reference type 'const std::__1::basic_string<char> &' to prevent copying
        for (const auto denominator : denominators)
             ^~~~~~~~~~~~~~~~~~~~~~~~
                        &
2 warnings generated.

My package.json looks as:

{
  "name": "appname",
  "private": true,
  "dependencies": {
    ... 

    "reactstrap": "^8.7.1",
    "redux": "^4.0.5",
    "sass-loader": "^10",
    "tinycolor2": "^1.4.2",
    "titleize": "^2.1.0",
    "yup": "^0.32.11"
  },
  "devDependencies": {
    "@webpack-cli/serve": "^1.1.0",
    "webpack-dev-server": "^3.11.2"
  },
  "engines": {
    "node": ">=16"
  }
}
Gotey
  • 449
  • 4
  • 15
  • 41
  • Those are warnings, not errors. Either way, you should switch your project to use [`sass`](https://www.npmjs.com/package/sass), not `node-sass`. – AKX Jan 19 '22 at 12:06
  • The yarn.lock file is not generating though – Gotey Jan 19 '22 at 13:17
  • I have removed node-sass with `yarn remove node-sass`, althought i keep getting that message when running yarn – Gotey Jan 19 '22 at 13:18
  • `yarn why node-sass` to figure out why it might still be installed. – AKX Jan 19 '22 at 13:19
  • I get `error No lockfile in this directory. Run "yarn install" to generate one.`. And I can't generate a lock file with `yarn install` – Gotey Jan 19 '22 at 13:24
  • Got it. `- "@rails#webpacker" depends on it - Hoisted from "@rails#webpacker#node-sass"` – Gotey Jan 19 '22 at 13:41
  • You could see if there's a newer version of that package then... Either way, those are warnings, they shouldn't stop installation. – AKX Jan 19 '22 at 13:44
  • somehow the lock is never generated when they show up – Gotey Jan 19 '22 at 14:03

1 Answers1

0

For anyone working with Vue 2 + quasar, what worked for me was removing node-sass with npm uninstall node-sass and not removing the sass loader.
You will get a tone of depreciation errors which I silenced by tweaking my vue.config.js to be as follows:

const path = require("path");

module.exports = {
  outputDir: path.resolve(__dirname, "../API/ClientApp/dist"),
  pluginOptions: {
    quasar: {
      importStrategy: "kebab",
      rtlSupport: false,
    },
  },
  css: {
    loaderOptions: {
      sass: {
        sassOptions: {
          quietDeps: true
        }
      }
    }
  },
  transpileDependencies: ["quasar"],
};

For completeness sake here is my package.json:

{
  "name": "client-app",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
    "test:unit": "vue-cli-service test:unit",
    "lint": "vue-cli-service lint",
    "lint:fix": "eslint --fix --ext .ts,.jsx ."
  },
  "dependencies": {
    "@quasar/extras": "^1.0.0",
    "axios": "^0.21.0",
    "core-js": "^3.6.5",
    "date-fns": "^2.16.1",
    "echarts": "^5.1.2",
    "particles.js": "^2.0.0",
    "quasar": "^1.0.0",
    "vue": "^2.6.11",
    "vue-axios": "^3.2.4",
    "vue-class-component": "^7.2.3",
    "vue-property-decorator": "^8.4.2",
    "vue-router": "^3.2.0",
    "vuex": "^3.4.0",
    "vuex-class": "^0.3.2"
  },
  "devDependencies": {
    "@types/jest": "^24.0.19",
    "@types/lodash": "^4.14.165",
    "@typescript-eslint/eslint-plugin": "^2.33.0",
    "@typescript-eslint/parser": "^2.33.0",
    "@vue/cli-plugin-babel": "~4.5.0",
    "@vue/cli-plugin-eslint": "~4.5.0",
    "@vue/cli-plugin-router": "~4.5.0",
    "@vue/cli-plugin-typescript": "~4.5.0",
    "@vue/cli-plugin-unit-jest": "~4.5.0",
    "@vue/cli-plugin-vuex": "~4.5.0",
    "@vue/cli-service": "~4.5.0",
    "@vue/eslint-config-prettier": "^6.0.0",
    "@vue/eslint-config-typescript": "^5.0.2",
    "@vue/test-utils": "^1.0.3",
    "eslint": "^6.7.2",
    "eslint-plugin-prettier": "^3.1.3",
    "eslint-plugin-vue": "^6.2.2",
    "moment": "^2.29.1",
    "prettier": "^1.19.1",
    "sass": "^1.26.5",
    "sass-loader": "^8.0.2",
    "typescript": "~3.9.3",
    "vue-cli-plugin-quasar": "~3.0.1",
    "vue-template-compiler": "^2.6.11"
  }
}
Tyler2P
  • 2,324
  • 26
  • 22
  • 31