this is my dockerfile:
FROM node:16
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 3000
CMD [ “npm”, “start” ]
i then try to “docker-compose build” and that works fine. when i do “docker-compose up -d” or “npm start” that’s where the error shows up:
start
ts-node-dev –max-http-header-size=106384 src/index.ts
node:internal/modules/cjs/loader:1031
throw err;
^
Require stack:
- /home/azureuser/[VM-NAME]/node_modules/.bin/ts-node-dev
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1028:15)
at Function.Module._load (node:internal/modules/cjs/loader:873:27)
at Module.require (node:internal/modules/cjs/loader:1100:19)
at require (node:internal/modules/cjs/helpers:119:18)
at Object. (/home/azureuser/[VM-NAME]/node_modules/.bin/ts-node-dev:25:10)
at Module._compile (node:internal/modules/cjs/loader:1198:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
at Module.load (node:internal/modules/cjs/loader:1076:32)
at Function.Module._load (node:internal/modules/cjs/loader:911:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
code: ‘MODULE_NOT_FOUND’,
requireStack: [ ‘/home/azureuser/[VM-NAME]/node_modules/.bin/ts-node-dev’ ]
}
i even went inside the container to that path, and ts-node-dev exists. how should i go about fixing this? i’m trying to get this service docker-ized and running on localhost. any input would be appreciated.
Rudra Singh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.