diamol
diamol copied to clipboard
CH 04 Access-Log displays errors for node-gyp during build
Exercise Chapter 4 Section 4.3 - App walkthrough: Node.js source code Page 54
Problem node-gyp rebuild fails with error (but looks like error is suppressed and build can continue)
Docker version
$ docker version
Client: Docker Engine - Community
Version: 20.10.16
API version: 1.41
Go version: go1.17.10
Git commit: aa7e414
Built: Thu May 12 09:17:23 2022
OS/Arch: linux/amd64
Context: default
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 20.10.16
API version: 1.41 (minimum version 1.12)
Go version: go1.17.10
Git commit: f756502
Built: Thu May 12 09:15:28 2022
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.6.4
GitCommit: 212e8b6fa2f44b9c21b2798135fc6fb7c53efc16
runc:
Version: 1.1.1
GitCommit: v1.1.1-0-g52de29d
docker-init:
Version: 0.19.0
GitCommit: de40ad0
Code version
$ git log -n 1
commit 71384f8c09a8e0b3867a2c73ae09549774a21e85 (HEAD -> master, origin/master, origin/HEAD)
Author: Elton Stoneman <[email protected]>
Date: Fri Mar 5 15:43:14 2021 +0000
Bump Apache versions
Additional context
Full docker build log below
Sending build context to Docker daemon 8.704kB
Step 1/10 : FROM diamol/node AS builder
---> 9dfa73010b19
Step 2/10 : WORKDIR /src
---> Using cache
---> 24ddfdd809f5
Step 3/10 : COPY src/package.json .
---> 27e1fd4434f0
Step 4/10 : RUN npm install
---> Running in 5626cf1d85ff
npm WARN deprecated [email protected]: Please upgrade to latest, formidable@v2 or formidable@v3! Check these notes: https://bit.ly/2ZEqIau
npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
> [email protected] install /src/node_modules/dtrace-provider
> node-gyp rebuild || node suppress-error.js
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack at PythonFinder.failNoPython (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:484:19)
gyp ERR! stack at PythonFinder.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:406:16)
gyp ERR! stack at F (/usr/local/lib/node_modules/npm/node_modules/which/which.js:68:16)
gyp ERR! stack at E (/usr/local/lib/node_modules/npm/node_modules/which/which.js:80:29)
gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/which/which.js:89:16
gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/isexe/index.js:42:5
gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/isexe/mode.js:8:5
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:153:21)
gyp ERR! System Linux 5.10.16.3-microsoft-standard-WSL2
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /src/node_modules/dtrace-provider
gyp ERR! node -v v10.16.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm WARN [email protected] No license field.
added 138 packages from 188 contributors and audited 138 packages in 9.468s
found 0 vulnerabilities
Removing intermediate container 5626cf1d85ff
---> 780dde1a6dd7
Step 5/10 : FROM diamol/node
---> 9dfa73010b19
Step 6/10 : EXPOSE 80
---> Using cache
---> d6ea7f58046c
Step 7/10 : CMD ["node", "server.js"]
---> Using cache
---> e89fa2a06fed
Step 8/10 : WORKDIR /app
---> Using cache
---> 86f1b2c3cb4f
Step 9/10 : COPY --from=builder /src/node_modules/ /app/node_modules/
---> Using cache
---> fbd893f10962
Step 10/10 : COPY src/ .
---> 0fa9d6e8e2a7
Successfully built 0fa9d6e8e2a7
Successfully tagged access-log:latest
I do note that the book does say (immediately following) :
You’ll see a whole lot of output from npm (which may show some error and warning messages too, but you can ignore those).
Happy to close this if this is expected behaviour