Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm install in docker failed #700

Open
fahmisdk6 opened this issue Apr 30, 2020 · 1 comment
Open

npm install in docker failed #700

fahmisdk6 opened this issue Apr 30, 2020 · 1 comment

Comments

@fahmisdk6
Copy link

Hi,

I tried to run npm run docker:build to create docker image, but it keep failing when it run npm install inside the docker.

Step 5/13 : RUN npm install
---> Running in 08e72c4b382a
npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! https://npm.community

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-04-30T07_52_11_026Z-debug.log
The command '/bin/sh -c npm install' returned a non-zero code: 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] docker:build: docker build -t probot-auto-merge .
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] docker:build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Inside the log :

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'run',
1 verbose cli 'docker:build' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'predocker:build', 'docker:build', 'postdocker:build' ]
5 info lifecycle [email protected]predocker:build: [email protected]
6 info lifecycle [email protected]
docker:build: [email protected]
7 verbose lifecycle [email protected]docker:build: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]
docker:build: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/fahmisidik/Document/probot-auto-merge/node_modules/.bin:/Users/fahmisidik/.rbenv/shims:/Users/fahmisidik/.rbenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/usr/local/MacGPG2/bin:/Users/fahmisidik/.rbenv/shims
9 verbose lifecycle [email protected]docker:build: CWD: /Users/fahmisidik/Document/probot-auto-merge
10 silly lifecycle [email protected]
docker:build: Args: [ '-c', 'docker build -t probot-auto-merge .' ]
11 silly lifecycle [email protected]docker:build: Returned: code: 1 signal: null
12 info lifecycle [email protected]
docker:build: Failed to exec docker:build script
13 verbose stack Error: [email protected] docker:build: docker build -t probot-auto-merge .
13 verbose stack Exit status 1
13 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack at EventEmitter.emit (events.js:198:13)
13 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:198:13)
13 verbose stack at maybeClose (internal/child_process.js:982:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid [email protected]
15 verbose cwd /Users/fahmisidik/Document/probot-auto-merge
16 verbose Darwin 18.7.0
17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "docker:build"
18 verbose node v10.16.2
19 verbose npm v6.9.0
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] docker:build: docker build -t probot-auto-merge .
22 error Exit status 1
23 error Failed at the [email protected] docker:build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

I don't know if this is an issue with this project or not.
Any help will be appreciated.

@joschi
Copy link
Contributor

joschi commented Jul 2, 2020

@fahmisdk6 Worked successfully on current master (7e10618) for me on macOS 10.15.5:

# docker version
Client: Docker Engine - Community
 Version:           19.03.8
 API version:       1.40
 Go version:        go1.12.17
 Git commit:        afacb8b
 Built:             Wed Mar 11 01:21:11 2020
 OS/Arch:           darwin/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.8
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.12.17
  Git commit:       afacb8b
  Built:            Wed Mar 11 01:29:16 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v1.2.13
  GitCommit:        7ad184331fa3e55e52b890ea95e65ba581ae3429
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

# node -v
v14.4.0

# npm -v
6.14.5

# npm run docker:build

> [email protected] docker:build /path/to/probot-auto-merge
> docker build -t probot-auto-merge .

Sending build context to Docker daemon  10.76MB
Step 1/13 : FROM node:alpine as builder
alpine: Pulling from library/node
cbdbe7a5bc2a: Pull complete
bdfc8e0b7a31: Pull complete
b0f8983c8893: Pull complete
057ed1351239: Pull complete
Digest: sha256:ae13d1ab371853dc03590ddee6b0901f0c66c3e107e78dc26e4bd673a7334b41
Status: Downloaded newer image for node:alpine
 ---> 5d97b3d11dc1
Step 2/13 : WORKDIR /app/auto-merge/
 ---> Running in 04f81ef6a3f3
Removing intermediate container 04f81ef6a3f3
 ---> 92b39d34fb0a
Step 3/13 : RUN apk add --no-cache --virtual .gyp python make g++
 ---> Running in 6c82ed7dc96b
fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/community/x86_64/APKINDEX.tar.gz
(1/22) Installing libbz2 (1.0.8-r1)
(2/22) Installing expat (2.2.9-r1)
(3/22) Installing libffi (3.2.1-r6)
(4/22) Installing gdbm (1.13-r1)
(5/22) Installing ncurses-terminfo-base (6.1_p20200118-r4)
(6/22) Installing ncurses-libs (6.1_p20200118-r4)
(7/22) Installing readline (8.0.1-r0)
(8/22) Installing sqlite-libs (3.30.1-r2)
(9/22) Installing python2 (2.7.18-r0)
(10/22) Installing make (4.2.1-r2)
(11/22) Installing binutils (2.33.1-r0)
(12/22) Installing gmp (6.1.2-r1)
(13/22) Installing isl (0.18-r0)
(14/22) Installing libgomp (9.2.0-r4)
(15/22) Installing libatomic (9.2.0-r4)
(16/22) Installing mpfr4 (4.0.2-r1)
(17/22) Installing mpc1 (1.1.0-r1)
(18/22) Installing gcc (9.2.0-r4)
(19/22) Installing musl-dev (1.1.24-r2)
(20/22) Installing libc-dev (0.7.2-r0)
(21/22) Installing g++ (9.2.0-r4)
(22/22) Installing .gyp (20200702.102502)
Executing busybox-1.31.1-r9.trigger
OK: 212 MiB in 38 packages
Removing intermediate container 6c82ed7dc96b
 ---> 4373cea5ddbb
Step 4/13 : COPY ./package*.json ./
 ---> 0079e75f32ae
Step 5/13 : RUN npm install
 ---> Running in a9fd9a5e5f8b

> [email protected] install /app/auto-merge/node_modules/dtrace-provider
> node-gyp rebuild || node suppress-error.js

make: Entering directory '/app/auto-merge/node_modules/dtrace-provider/build'
  TOUCH Release/obj.target/DTraceProviderStub.stamp
make: Leaving directory '/app/auto-merge/node_modules/dtrace-provider/build'

> [email protected] postinstall /app/auto-merge/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
> https://opencollective.com/core-js
> https://www.patreon.com/zloirock

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)


> [email protected] postinstall /app/auto-merge/node_modules/nodemon
> node bin/postinstall || exit 0

Love nodemon? You can now support the project via the open collective:
 > https://opencollective.com/nodemon/donate

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

added 2302 packages from 1447 contributors and audited 2305 packages in 45.667s

52 packages are looking for funding
  run `npm fund` for details

found 4770 low severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details
Removing intermediate container a9fd9a5e5f8b
 ---> db14b4fba679
Step 6/13 : FROM node:alpine as app
 ---> 5d97b3d11dc1
Step 7/13 : WORKDIR /app/auto-merge/
 ---> Using cache
 ---> 92b39d34fb0a
Step 8/13 : COPY --from=builder /app/auto-merge/node_modules/ ./node_modules/
 ---> 0c11a2ca36e0
Step 9/13 : COPY . ./
 ---> be769e106eb0
Step 10/13 : RUN npm run build
 ---> Running in cae64466e4e5

> [email protected] build /app/auto-merge
> tsc -p tsconfig.json

Removing intermediate container cae64466e4e5
 ---> 2b0b316b7c34
Step 11/13 : EXPOSE 3000
 ---> Running in d885c1083343
Removing intermediate container d885c1083343
 ---> 5ce898ce96f6
Step 12/13 : COPY .env ./
 ---> 94081b2b0f04
Step 13/13 : ENTRYPOINT [ "npm", "start" ]
 ---> Running in 8301cdea428d
Removing intermediate container 8301cdea428d
 ---> 117471b7061f
Successfully built 117471b7061f
Successfully tagged probot-auto-merge:latest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants