Why do I get this error message: ERROR [4/5] RUN npm install --only=prod

Viewed 17

I am following a tutorial and the following docker file is a part of the project:

FROM node:alpine

WORKDIR /app
COPY package.json .
RUN npm install --only=prod
COPY . .

CMD ["npm", "start"]

When I try skaffold dev I get this result:

time="2022-09-23T00:49:04-07:00" level=debug msg="skaffold API not starting as it's not requested" subtask=-1 task=DevLoop
time="2022-09-23T00:49:04-07:00" level=info msg="Skaffold &{Version:v1.38.0 ConfigVersion:skaffold/v2beta28 GitVersion: GitCommit:89b789ddcfe00d2fe7626fd86ef39a3eb6b455c5 BuildDate:2022-04-06T15:02:40Z GoVersion:go1.17.7 Compiler:gc Platform:windows/amd64 User:}" subtask=-1 task=DevLoop
time="2022-09-23T00:49:04-07:00" level=info msg="Loaded Skaffold defaults from \"C:\\\\Users\\\\A\\\\.skaffold\\\\config\"" subtask=-1 task=DevLoop
time="2022-09-23T00:49:04-07:00" level=debug msg="config version out of date: upgrading to latest \"skaffold/v2beta28\"" subtask=-1 task=DevLoop
time="2022-09-23T00:49:04-07:00" level=debug msg="parsed 1 configs from configuration file E:\\microServices\\codes\\section16-checkpoint\\ticketing\\skaffold.yaml" subtask=-1 task=DevLoop
time="2022-09-23T00:49:04-07:00" level=info msg="map entry found when executing locate for &{wdrcoo/auth auth 0xc0007b5f10 {0xc000a2f130 <nil> <nil> <nil> <nil> <nil> <nil>} [] {[] []} []} of type *v1.Artifact and pointer: 824644128128" subtask=-1 task=DevLoop
time="2022-09-23T00:49:04-07:00" level=info msg="map entry found when executing locate for &{wdrcoo/ticketing-client client 0xc0007b5f80 {0xc000a2f1e0 <nil> <nil> <nil> <nil> <nil> <nil>} [] {[] []} []} of type *v1.Artifact and pointer: 824644128320" subtask=-1 task=DevLoop
time="2022-09-23T00:49:04-07:00" level=info msg="map entry found when executing locate for &{wdrcoo/tickets tickets 0xc000012000 {0xc000a2f290 <nil> <nil> <nil> <nil> <nil> <nil>} [] {[] []} []} of type *v1.Artifact and pointer: 824644128512" subtask=-1 task=DevLoop
time="2022-09-23T00:49:04-07:00" level=info msg="Using kubectl context: docker-desktop" subtask=-1 task=DevLoop
time="2022-09-23T00:49:04-07:00" level=debug msg="getting client config for kubeContext: `docker-desktop`" subtask=-1 task=DevLoop
time="2022-09-23T00:49:04-07:00" level=debug msg="could not parse date \"\"" subtask=-1 task=DevLoop
time="2022-09-23T00:49:04-07:00" level=debug msg="config version out of date: upgrading to latest \"skaffold/v2beta28\"" subtask=-1 task=DevLoop
time="2022-09-23T00:49:04-07:00" level=debug msg="could not parse date \"\"" subtask=-1 task=DevLoop
time="2022-09-23T00:49:04-07:00" level=debug msg="config version out of date: upgrading to latest \"skaffold/v2beta28\"" subtask=-1 task=DevLoop
time="2022-09-23T00:49:04-07:00" level=debug msg="Running command: [minikube version --output=json]" subtask=-1 task=DevLoop
time="2022-09-23T00:49:04-07:00" level=debug msg="setting Docker user agent to skaffold-v1.38.0" subtask=-1 task=DevLoop
time="2022-09-23T00:49:04-07:00" level=debug msg="CLI platforms provided: \"\"" subtask=-1 task=DevLoop
time="2022-09-23T00:49:04-07:00" level=debug msg="getting client config for kubeContext: `docker-desktop`" subtask=-1 task=DevLoop
time="2022-09-23T00:49:05-07:00" level=debug msg="platforms detected from active kubernetes cluster nodes: \"linux/amd64\"" subtask=-1 task=DevLoop
time="2022-09-23T00:49:05-07:00" level=debug msg="platforms selected for artifact \"wdrcoo/auth\": \"linux/amd64\"" subtask=-1 task=DevLoop
time="2022-09-23T00:49:05-07:00" level=debug msg="platforms selected for artifact \"wdrcoo/ticketing-client\": \"linux/amd64\"" subtask=-1 task=DevLoop        
time="2022-09-23T00:49:05-07:00" level=debug msg="platforms selected for artifact \"wdrcoo/tickets\": \"linux/amd64\"" subtask=-1 task=DevLoop
time="2022-09-23T00:49:05-07:00" level=debug msg="Using builder: local" subtask=-1 task=DevLoop
time="2022-09-23T00:49:05-07:00" level=info msg="build concurrency first set to 1 parsed from *local.Builder[0]" subtask=-1 task=DevLoop
time="2022-09-23T00:49:05-07:00" level=info msg="final build concurrency value is 1" subtask=-1 task=DevLoop
Listing files to watch...
 - wdrcoo/auth
time="2022-09-23T00:49:06-07:00" level=debug msg="Found dependencies for dockerfile: [{package.json /app true 4 4} {. /app true 6 6}]" subtask=-1 task=DevLoop
 - wdrcoo/ticketing-client
time="2022-09-23T00:49:06-07:00" level=debug msg="Found dependencies for dockerfile: [{package.json /app true 4 4} {. /app true 6 6}]" subtask=-1 task=DevLoop
 - wdrcoo/tickets
time="2022-09-23T00:49:06-07:00" level=debug msg="Found dependencies for dockerfile: [{package.json /app true 4 4} {. /app true 6 6}]" subtask=-1 task=DevLoop 
time="2022-09-23T00:49:06-07:00" level=info msg="refusing to deploy/delete non {json, yaml} file E:\\microServices\\codes\\section16-checkpoint\\ticketing\\infra\\k8s\\.DS_Store" subtask=-1 task=DevLoop
time="2022-09-23T00:49:06-07:00" level=info msg="If you still wish to deploy this file, please specify it directly, outside a glob pattern." subtask=-1 task=DevLoop
time="2022-09-23T00:49:06-07:00" level=info msg="List generated in 1.73 second" subtask=-1 task=DevLoop
Generating tags...
 - wdrcoo/auth -> time="2022-09-23T00:49:06-07:00" level=debug msg="Running command: [git describe --tags --always]" subtask=-1 task=Build
time="2022-09-23T00:49:06-07:00" level=debug msg="Running command: [git describe --tags --always]" subtask=-1 task=Build
time="2022-09-23T00:49:06-07:00" level=debug msg="Running command: [git describe --tags --always]" subtask=-1 task=Build
time="2022-09-23T00:49:06-07:00" level=debug msg="generating tag: unable to find git commit: running [git describe --tags --always]\n - stdout: \"\"\n - stderr: \"fatal: not a git repository (or any of the parent directories): .git\\n\"\n - cause: exit status 128" subtask=wdrcoo/auth task=Build
time="2022-09-23T00:49:06-07:00" level=debug msg="Using a fall-back tagger" subtask=wdrcoo/auth task=Build
wdrcoo/auth:latest
 - wdrcoo/ticketing-client -> time="2022-09-23T00:49:06-07:00" level=debug msg="generating tag: unable to find git commit: running [git describe --tags --always]\n - stdout: \"\"\n - stderr: \"fatal: not a git repository (or any of the parent directories): .git\\n\"\n - cause: exit status 128" subtask=wdrcoo/ticketing-client task=Build
time="2022-09-23T00:49:06-07:00" level=debug msg="Using a fall-back tagger" subtask=wdrcoo/ticketing-client task=Build
wdrcoo/ticketing-client:latest
 - wdrcoo/tickets -> time="2022-09-23T00:49:06-07:00" level=debug msg="generating tag: unable to find git commit: running [git describe --tags --always]\n - stdout: \"\"\n - stderr: \"fatal: not a git repository (or any of the parent directories): .git\\n\"\n - cause: exit status 128" subtask=wdrcoo/tickets task=Build
time="2022-09-23T00:49:06-07:00" level=debug msg="Using a fall-back tagger" subtask=wdrcoo/tickets task=Build
wdrcoo/tickets:latest
Some taggers failed. Rerun with -vdebug for errors.
time="2022-09-23T00:49:06-07:00" level=info msg="Tags generated in 103.9468ms" subtask=-1 task=Build
Checking cache...
time="2022-09-23T00:49:06-07:00" level=debug msg="Could not import artifact from Docker, building instead (import of missing images disabled)" subtask=-1 task=Build
time="2022-09-23T00:49:06-07:00" level=debug msg="Could not import artifact from Docker, building instead (import of missing images disabled)" subtask=-1 task=Build
 - wdrcoo/auth: Not found. Building
 - wdrcoo/ticketing-client: Not found. Building
 - wdrcoo/tickets: Not found. Building
time="2022-09-23T00:49:06-07:00" level=info msg="Cache check completed in 19.6346ms" subtask=-1 task=Build
Starting build...
Found [docker-desktop] context, using local docker daemon.
Building [wdrcoo/tickets]...
Target platforms: [linux/amd64]
time="2022-09-23T00:49:06-07:00" level=debug msg="setting DOCKER_BUILDKIT=1 for docker build for artifact \"wdrcoo/tickets\" since it targets platform {\"amd64\" \"linux\" \"\" [] \"\"}" subtask=wdrcoo/tickets task=Build
time="2022-09-23T00:49:06-07:00" level=debug msg="Running command: [docker build tickets --file E:\\microServices\\codes\\section16-checkpoint\\ticketing\\tickets\\Dockerfile -t wdrcoo/tickets:latest --platform linux/amd64]" subtask=wdrcoo/tickets task=Build
failed to get console mode for stdin: The handle is invalid.
[+] Building 6.2s (11/11) FINISHED
 => [internal] load build definition from Dockerfile                                                                                                      1.5s 
 => => transferring dockerfile: 31B                                                                                                                       0.0s 
 => [internal] load .dockerignore                                                                                                                         2.0s 
 => => transferring context: 34B                                                                                                                          0.0s 
 => [internal] load metadata for docker.io/library/node:alpine                                                                                            1.6s 
 => [auth] library/node:pull token for registry-1.docker.io                                                                                               0.0s 
 => [internal] load build context                                                                                                                         1.0s 
 => => transferring context: 1.15kB                                                                                                                       0.0s 
 => [1/5] FROM docker.io/library/node:alpine@sha256:831d5eca5b7437a8132031a25bd18bdb0399e7415d4e8e02a8c14426b6dcf17f                                      0.7s 
 => => resolve docker.io/library/node:alpine@sha256:831d5eca5b7437a8132031a25bd18bdb0399e7415d4e8e02a8c14426b6dcf17f                                      0.7s 
 => CACHED [2/5] WORKDIR /app                                                                                                                             0.0s 
 => CACHED [3/5] COPY package.json .                                                                                                                      0.0s 
 => CACHED [4/5] RUN npm install --only=prod                                                                                                              0.0s 
 => CACHED [5/5] COPY . .                                                                                                                                 0.0s 
 => exporting to image                                                                                                                                    0.9s 
 => => exporting layers                                                                                                                                   0.0s 
 => => writing image sha256:450754761acf6913da790a9bb3fca601263958af62cff82032719317cab25ac4                                                              0.1s 
 => => naming to docker.io/wdrcoo/tickets:latest                                                                                                          0.0s 
Build [wdrcoo/tickets] succeeded
Building [wdrcoo/auth]...
Target platforms: [linux/amd64]
time="2022-09-23T00:49:14-07:00" level=debug msg="setting DOCKER_BUILDKIT=1 for docker build for artifact \"wdrcoo/auth\" since it targets platform {\"amd64\" 
\"linux\" \"\" [] \"\"}" subtask=wdrcoo/auth task=Build
time="2022-09-23T00:49:14-07:00" level=debug msg="Running command: [docker build auth --file E:\\microServices\\codes\\section16-checkpoint\\ticketing\\auth\\Dockerfile -t wdrcoo/auth:latest --platform linux/amd64]" subtask=wdrcoo/auth task=Build
failed to get console mode for stdin: The handle is invalid.
[+] Building 28.3s (8/9)
 => [internal] load build definition from Dockerfile                                                                                                      0.9s 
 => => transferring dockerfile: 31B                                                                                                                       0.0s 
 => [internal] load .dockerignore                                                                                                                         1.6s 
 => => transferring context: 34B                                                                                                                          0.0s 
 => [internal] load metadata for docker.io/library/node:alpine                                                                                            1.4s 
 => [internal] load build context                                                                                                                         1.2s 
 => => transferring context: 919B                                                                                                                         0.0s 
 => [1/5] FROM docker.io/library/node:alpine@sha256:831d5eca5b7437a8132031a25bd18bdb0399e7415d4e8e02a8c14426b6dcf17f                                      0.9s 
 => => resolve docker.io/library/node:alpine@sha256:831d5eca5b7437a8132031a25bd18bdb0399e7415d4e8e02a8c14426b6dcf17f                                      0.9s 
 => CACHED [2/5] WORKDIR /app                                                                                                                             0.0s 
 => CACHED [3/5] COPY package.json .                                                                                                                      0.0s 
 => ERROR [4/5] RUN npm install --only=prod                                                                                                              23.6s 
------
 > [4/5] RUN npm install --only=prod:
#8 2.755 npm WARN config only Use `--omit=dev` to omit dev dependencies from the install.
#8 21.49 npm notice
#8 21.49 npm notice New patch version of npm available! 8.19.1 -> 8.19.2
#8 21.49 npm notice Changelog: <https://github.com/npm/cli/releases/tag/v8.19.2>
#8 21.49 npm notice Run `npm install -g npm@8.19.2` to update!
#8 21.49 npm notice
#8 21.49 npm ERR! code ETARGET
#8 21.50 npm ERR! notarget No matching version found for @learnertester/common@1.0.0.
#8 21.50 npm ERR! notarget In most cases you or one of your dependencies are requesting
#8 21.50 npm ERR! notarget a package version that doesn't exist.
#8 21.50
#8 21.50 npm ERR! A complete log of this run can be found in:
#8 21.50 npm ERR!     /root/.npm/_logs/2022-09-23T07_49_22_794Z-debug-0.log
------
executor failed running [/bin/sh -c npm install --only=prod]: exit code: 1
Building [wdrcoo/ticketing-client]...
Target platforms: [linux/amd64]
Build [wdrcoo/ticketing-client] was canceled
build [wdrcoo/auth] failed: exit status 1. Docker build ran into internal error. Please retry.
If this keeps happening, please open an issue..
time="2022-09-23T00:49:43-07:00" level=debug msg="exporting metrics" subtask=-1 task=DevLoop
time="2022-09-23T00:49:44-07:00" level=debug msg="metrics uploading complete in 940.6484ms" subtask=-1 task=DevLoop

I don't know what is the problem? If there is any other file that I can add to my question please let me know? I am new to Docker and Kubernetes and don't know how to fix it?

This is the project's complete code:

https://github.com/Zohalmohal/test3

0 Answers
Related