Adding other packages to the package.json works well. However installing a local package which is a folder cannot.
Part of my Dockerfile is the following:
COPY package*.json ./
RUN npm cache clean --force
RUN rm -rf node_modules
COPY . .
RUN npm i
RUN npm i ./textwrap-pkg // <--- it is well executed ! if I make a typo it would raise an error.
So as you can see the folder textwrap-pkg
is well copied part of COPY . .
(I also logged into the image and could see). What I cannot find, and which is the problem, is the folder of the package in node_modules
inside the Docker image.
The dependency in package.json
is fine as it works on the host machine:
"textwrap": "file:./textwrap-pkg"
note: I tried removing volumes and images like suggested.
Edit
After a bit of investigations, I found out the source of the problem!
node_modules# ls -l textwrap-wasm-demo
textwrap-wasm-demo -> ../textwrap/examples/wasm/pkg
Isn't this awesome? It's a link. I followed with this, now I have files well present but still it does not work!