** edit - important detail: verdaccio is also running in a docker container. Issue seems to be container to container communication. I have the npm registry set to localhost but I think it's trying to connect to localhost in the container's context and not the container host.
I'm trying to install a package from a Verdaccio registry running on localhost and not sure how to change either the skaffold configuration or the dockerfile to change the registry from npmjs to Verdaccio. The 404 error I'm receiving is below:
npm notice npm ERR! code E404 npm ERR! 404 Not Found - GET https://registry.npmjs.org/@flashsparkmedia%2fcommon - Not found npm ERR! 404 npm ERR! 404 '@flashsparkmedia/common@^1.0.3' is not in the npm registry. npm ERR! 404 You should bug the author to publish it (or use the name yourself!) npm ERR! 404 npm ERR! 404 Note that you can also install from a npm ERR! 404 tarball, folder, http url, or git url.
Here is my dockerfile and skaffold.yaml for reference:
apiVersion: skaffold/v2beta4
kind: Config
deploy:
kubectl:
manifests:
- ./infra/k8s/*
build:
local:
push: false
artifacts:
- image: flashsparkmedia/auth
context: auth
docker:
dockerfile: Dockerfile
network: host
sync:
manual:
- src: 'src/**/*.ts'
dest: .
- image: flashsparkmedia/client
context: client
docker:
dockerfile: Dockerfile
sync:
manual:
- src: '**/*.js'
dest: .
FROM node:alpine
WORKDIR /app
ARG NPM_TOKEN
COPY .npmrc .
COPY package.json .
RUN npm install --only-prod
RUN rm -f .npmrc
COPY . .
CMD npm start
I also have a .npmrc file in root directory referencing localhost:4873 with an _authToken variable
question from:https://stackoverflow.com/questions/65645708/using-verdaccio-registry-with-skaffold