I was running this code from the docker file to generate converted js files from the typescript code.
FROM node:18.3.0
WORKDIR /src
COPY package*.json ./
COPY tsconfig.json ./
RUN npm install
RUN tsc
COPY . ./
EXPOSE 5000
CMD ["npm", "run", "start"]
However, it shows the follow error on running docker build:-
here’s my package.json
{
"name": "example",
"version": "1.0.0",
"description": "",
"main": "index.ts",
"license": "MIT",
"private": true,
"scripts": {
"start": "node ./dist/index.js",
"dev": "nodemon ./src/index.ts",
},
"dependencies": {
"@types/express": "^4.17.17",
"express": "^4.18.2",
"ts-node": "^10.9.1",
"typescript": "^5.2.2"
},
"devDependencies": {
"@types/node": "^20.6.0",
"nodemon": "^3.0.1"
}
}
why’s the error?