11

I'm deploying my Vue.js project on GitLab pages.

Running npm run build during GitLab CI pipeline results in errors:

Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
ModuleBuildError: Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
Error: Node Sass does not yet support your current environment: Linux 64-bit with Unsupported runtime (88)

I don't get any errors during npm run build locally.

Appreciate if someone can help.

john grad
  • 141
  • 1
  • 6

3 Answers3

19

node-sass does not support Node 15 (runtime **) currently. It will come with when v5 when it is published to NPM. You can subscribe to the tracking issue here https://github.com/sass/node-sass/issues/2965 node-sass 4.x will not receive support for Node 15 https://github.com/sass/node-sass#node-version-support-policy, so you may want to downgrade your Node version to 14 currently

nschonni
  • 4,069
  • 1
  • 28
  • 37
  • I mysteriously ran into this same issue though my O/S had `node` version `12.x` on it. This happened because I `activated` a `Python virtual environment` not knowing that it had `node` version `15.x` as part of it, which took precedence (path-wise), thus the failure. I `deactivate`d the environment and everything worked fine. Just a tip in case others face this issue.. – NYCeyes Feb 02 '21 at 20:07
  • To downgrade node with nvm you can run e.g. `$ nvm install 14.9.0`. However that alone didn't fix it for me. I had to go all the way back to `nvm install 13.14.0` and then also had to run `npm rebuild node-sass`. – twhitney Aug 16 '21 at 20:51
1

As mentioned in a comment, I also had to run npm rebuild node-sass. So my complete steps to fix were:

nvm ls-remote | grep v14.
nvm install 14.17.5
npm rebuild node-sass
npm install
npm run build
twhitney
  • 167
  • 3
  • 7
0

Make sure you have added both packages in your package.json

  1. node-sass
  2. sass-loader
Amaarockz
  • 4,348
  • 2
  • 9
  • 27