Closed rakeshar3796 closed 4 months ago
You need to run npm install from inside the container, not outside. And ignore node_modules.
https://www.docker.com/blog/getting-started-with-docker-using-node-jspart-i/
COPY package.json package.json COPY package-lock.json package-lock.json RUN npm install
Got that, was trying the same earlier and now found the root cause, volume mount is causing the issue, resolved. Thanks for the prompt response! Appreciated.
Is Your Question Already Answered?
Personal Diagnostics
Please answer the following questions:
JavaScript includes a
setTimeout
function:Functions are a type of primitive value in JavaScript:
Objects can be shared between isolates:
The Code
main.mjs
and then runnode main.mjs
.Am facing the below issue in Docker, i tried ignoring
node_modules
in my.dockerignore
as mentioned hereIf my file has below snippet, am seeing the above error during docker up, if i remove that its running fine. My node version is 18 and even tried v20.