1

My .yml file in gitlab looks like this

stages:
  - prepare_build
  - save_build
  - deployment
image: node:latest
cache:
  paths:
  - node_modules/
prepare_build:
  stage: prepare_build
  script:
  - npm install
  - npm run build
  artifacts:
    paths:
      - build

Below is my package.json file with node-sass and sass-loader

"node-sass": "^4.14.1",
"sass-loader": "^7.0.1",

My local Machine, build is success and it has node and npm versions

node : 14.5.0
npm : 6.14.8

Below is my GitLab build error

npm ERR! code 1
npm ERR! path /builds/../../node_modules/node-sass
npm ERR! command failed
npm ERR! command sh -c node scripts/build.js
npm ERR! Building: /usr/local/bin/node /builds./../.././node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=

what version combinations i have to update in my package.json? TIA

2
  • Yes you have to put version combinations in package.json Commented Apr 28, 2021 at 11:00
  • @GopalJoshi what are the combinations for latest node? Commented Apr 28, 2021 at 11:07

1 Answer 1

2

If you do not specify the node image, the default is the latest which is not compatible with the version of node-sass you are using, try to specify in the build job the version of the node image:

prepare_build:
  image: node: 10.15.3
  ...
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.