При запуске npm install выдается ошибка с gitlab-ci на Docker - PullRequest
1 голос
/ 08 января 2020

Я пытаюсь собрать с помощью gitlab-ci в командной строке, и при запуске npm install у меня появляется эта ошибка ниже.

$ npm install
158 > uws@9.14.0 install /builds/Digistarts/petlig-admin/node_modules/uws
159 > node-gyp rebuild > build_log.txt 2>&1 || exit 0
160 > grpc@1.18.0 install /builds/Digistarts/petlig-admin/node_modules/grpc
161 > node-pre-gyp install --fallback-to-build --library=static_library
162 node-pre-gyp WARN Using request for node-pre-gyp https download 
163 node-pre-gyp WARN Tried to download(404): https://node-precompiled-binaries.grpc.io/grpc/v1.18.0/node-v72-linux-x64-musl.tar.gz 
164 node-pre-gyp WARN Pre-built binaries not found for grpc@1.18.0 and node@12.14.0 (node-v72 ABI, musl) (falling back to source compile with node-gyp) 
165 gyp ERR! build error 
166 gyp ERR! stack Error: not found: make
167 gyp ERR! stack     at getNotFoundError (/usr/lib/node_modules/npm/node_modules/which/which.js:13:12)
168 gyp ERR! stack     at F (/usr/lib/node_modules/npm/node_modules/which/which.js:68:19)
169 gyp ERR! stack     at E (/usr/lib/node_modules/npm/node_modules/which/which.js:80:29)
170 gyp ERR! stack     at /usr/lib/node_modules/npm/node_modules/which/which.js:89:16
171 gyp ERR! stack     at /usr/lib/node_modules/npm/node_modules/isexe/index.js:42:5
172 gyp ERR! stack     at /usr/lib/node_modules/npm/node_modules/isexe/mode.js:8:5
173 gyp ERR! stack     at FSReqCallback.oncomplete (fs.js:158:21)
174 gyp ERR! System Linux 4.19.78-coreos
175 gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--library=static_library" "--module=/builds/Digistarts/petlig-admin/node_modules/grpc/src/node/extension_binary/node-v72-linux-x64-musl/grpc_node.node" "--module_name=grpc_node" "--module_path=/builds/Digistarts/petlig-admin/node_modules/grpc/src/node/extension_binary/node-v72-linux-x64-musl" "--napi_version=5" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v72"
176 gyp ERR! cwd /builds/Digistarts/petlig-admin/node_modules/grpc
177 gyp ERR! node -v v12.14.0
178 gyp ERR! node-gyp -v v5.0.5
179 gyp ERR! not ok 
180 node-pre-gyp ERR! build error 
181 node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/builds/Digistarts/petlig-admin/node_modules/grpc/src/node/extension_binary/node-v72-linux-x64-musl/grpc_node.node --module_name=grpc_node --module_path=/builds/Digistarts/petlig-admin/node_modules/grpc/src/node/extension_binary/node-v72-linux-x64-musl --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
182 node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/builds/Digistarts/petlig-admin/node_modules/grpc/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
183 node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:210:5)
184 node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1021:16)
185 node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
186 node-pre-gyp ERR! System Linux 4.19.78-coreos
187 node-pre-gyp ERR! command "/usr/bin/node" "/builds/Digistarts/petlig-admin/node_modules/grpc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
188 node-pre-gyp ERR! cwd /builds/Digistarts/petlig-admin/node_modules/grpc
189 node-pre-gyp ERR! node -v v12.14.0
190 node-pre-gyp ERR! node-pre-gyp -v v0.12.0
191 node-pre-gyp ERR! not ok 
192 Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/builds/Digistarts/petlig-admin/node_modules/grpc/src/node/extension_binary/node-v72-linux-x64-musl/grpc_node.node --module_name=grpc_node --module_path=/builds/Digistarts/petlig-admin/node_modules/grpc/src/node/extension_binary/node-v72-linux-x64-musl --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
193 npm WARN app@0.0.0 No description
194 npm WARN app@0.0.0 No repository field.
195 npm WARN app@0.0.0 No license field.
196 npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/fsevents):
197 npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
198 npm ERR! code ELIFECYCLE
199 npm ERR! errno 1
200 npm ERR! grpc@1.18.0 install: `node-pre-gyp install --fallback-to-build --library=static_library`
201 npm ERR! Exit status 1
202 npm ERR! 
203 npm ERR! Failed at the grpc@1.18.0 install script.
204 npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
205 npm ERR! A complete log of this run can be found in:
206 npm ERR!     /root/.npm/_logs/2020-01-08T20_09_43_203Z-debug.log
207 ERROR: Job failed: exit code 1

Я уже пытался установить node-pre- Гип, но та же ошибка. Он просто перестал работать. Работал год. Мой конфиг CI ниже.

image: docker:latest

services:
- docker:dind

before_script:
  - apk add --no-cache curl jq python py-pip
  - apk add --no-cache bash
  - apk add --update ruby-dev
  #- gem install compass
  - apk add --update nodejs nodejs-npm
  - apk add --no-cache git
  - node -v
  - npm -v
  - npm install
  - npm install -g gulp bower
  - gulp -v
  - bower install --allow-root
  - pip install awscli

stages:
  - build
  - build-staging
  - build-dev

build:
  stage: build
  script:
    - ./build.sh
    - ./deploy.sh production `cat VERSION`
  only:
    - master

build-staging:
  stage: build-staging
  script:
    - ./build.sh
    - ./deploy.sh staging `cat VERSION`
  only:
    - staging

build-dev:
  stage: build-dev
  script:
    - ./build.sh
    - ./deploy.sh development `cat VERSION`
  only:
    - develop

1 Ответ

2 голосов
/ 09 января 2020

Вы пропустили некоторые требования к сборке в вашем альпийском образе

gyp ERR! stack Error: not found: make

Чтобы установить эти инструменты, добавив следующую команду под "before_script":

apk add --virtual build-dependencies build-base gcc
...