我在 gitlab 中的 .yml
文件是这样的
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
下面是我的 package.json
文件,其中包含 node-sass
和 sass-loader
"node-sass": "^4.14.1",
"sass-loader": "^7.0.1",
我的本地机器,构建成功,并且有 node 和 npm 版本
node : 14.5.0
npm : 6.14.8
下面是我的 GitLab 构建错误
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=
我必须在 package.json
中更新哪些版本组合? TIA
答案 0 :(得分:2)
如果不指定节点镜像,默认是最新的,与你使用的node-sass版本不兼容,尝试在构建作业中指定节点镜像的版本:
prepare_build:
image: node: 10.15.3
...