piyushsachdeva / CKA-2024

This repository contains the notes and code snippets of the CKA 2024 YouTube Playlist. The content is based on the latest 2024 curriculum and includes hands-on demos, assignments, and exam-based scenarios. I will be covering everything from the basics to the advanced level.
355 stars 559 forks source link

day3 npm error #4

Open luffyxxsenpai opened 1 month ago

luffyxxsenpai commented 1 month ago

in the day3 multistage file , i recieved this error

Step 6/8 : RUN npm run build
 ---> Running in 436caa2eb802
npm error Missing script: "build"
npm error
npm error To see a list of scripts, run:
npm error   npm run

npm error A complete log of this run can be found in: /root/.npm/_logs/2024-09-07T08_05_04_400Z-debug-0.log
The command '/bin/sh -c npm run build' returned a non-zero code: 1

this is the complete docker build output

docker build -t todomulti:v1  .
DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
            Install the buildx component to build images with BuildKit:
            https://docs.docker.com/go/buildx/

Sending build context to Docker daemon  6.734MB
Step 1/8 : FROM node:18-alpine AS installer
18-alpine: Pulling from library/node
43c4264eed91: Pull complete 
3696426c5aa2: Pull complete 
cdccf44a82db: Pull complete 
21f39b9ddd19: Pull complete 
Digest: sha256:b5b8fd22b37b34e61c70d960cb6049c8b3f02525864dc2f677b54fa9e0ceff58
Status: Downloaded newer image for node:18-alpine
 ---> f48cc5826852
Step 2/8 : WORKDIR /app
 ---> Running in ee06a10e9cae
 ---> Removed intermediate container ee06a10e9cae
 ---> bc3db8cf4016
Step 3/8 : COPY package*.json .
 ---> fca23256b62f
Step 4/8 : RUN npm install
 ---> Running in 42dfaf4166bd
npm warn deprecated @npmcli/move-file@1.1.2: This functionality has been moved to @npmcli/fs
npm warn deprecated are-we-there-yet@3.0.1: This package is no longer supported.
npm warn deprecated npmlog@6.0.2: This package is no longer supported.
npm warn deprecated gauge@4.0.4: This package is no longer supported.
npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported

added 490 packages, and audited 491 packages in 22s

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

4 vulnerabilities (3 high, 1 critical)

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.
npm notice
npm notice New minor version of npm available! 10.7.0 -> 10.8.3
npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.8.3
npm notice To update run: npm install -g npm@10.8.3
npm notice
 ---> Removed intermediate container 42dfaf4166bd
 ---> fe57c2be707c
Step 5/8 : COPY . .
 ---> 66319f3b6670
Step 6/8 : RUN npm run build
 ---> Running in b6a7dc6a3257
npm error Missing script: "build"
npm error
npm error To see a list of scripts, run:
npm error   npm run

npm error A complete log of this run can be found in: /root/.npm/_logs/2024-09-07T08_02_52_088Z-debug-0.log
The command '/bin/sh -c npm run build' returned a non-zero code: 1

getting-started-app master*​​ 󰞨 nvim Dockerfile

getting-started-app master*​​ 󱍢 nvim Dockerfile 

getting-started-app master*​​ 󱍢 docker build -t todomulti:v1  .
DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
            Install the buildx component to build images with BuildKit:
            https://docs.docker.com/go/buildx/

Sending build context to Docker daemon  6.734MB
Step 1/8 : FROM node:18-alpine AS installer
 ---> f48cc5826852
Step 2/8 : WORKDIR /app
 ---> Using cache
 ---> bc3db8cf4016
Step 3/8 : COPY package*.json ./
 ---> c71d81469390
Step 4/8 : RUN npm install
 ---> Running in 2ca1d6638816
npm warn deprecated are-we-there-yet@3.0.1: This package is no longer supported.
npm warn deprecated @npmcli/move-file@1.1.2: This functionality has been moved to @npmcli/fs
npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
npm warn deprecated npmlog@6.0.2: This package is no longer supported.
npm warn deprecated gauge@4.0.4: This package is no longer supported.
npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported

added 490 packages, and audited 491 packages in 20s

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

4 vulnerabilities (3 high, 1 critical)

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.
npm notice
npm notice New minor version of npm available! 10.7.0 -> 10.8.3
npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.8.3
npm notice To update run: npm install -g npm@10.8.3
npm notice
 ---> Removed intermediate container 2ca1d6638816
 ---> 9b734df48283
Step 5/8 : COPY . .
 ---> a422006ebf3e
Step 6/8 : RUN npm run build
 ---> Running in 436caa2eb802
npm error Missing script: "build"
npm error
npm error To see a list of scripts, run:
npm error   npm run

npm error A complete log of this run can be found in: /root/.npm/_logs/2024-09-07T08_05_04_400Z-debug-0.log
The command '/bin/sh -c npm run build' returned a non-zero code: 1
piyushsachdeva commented 4 days ago

Hi, Looks like the issue with your application code, possibly with missing the build script in package.json. Can you try running the npm commands manually and share the results? Also, is your source code publicly available?

Regards, Piyush