Hi, I’m new to resin.io to deploy node applications out to devices and it’s great!
I am just having a little trouble specifying a registry for npm to use. . I’ve added a .npmrc file to my project to specify the registry, but it seems whatever I do, it’s determined to use registry.npmjs.org
Hey, just checked it out, if you have a properly formatted .npmrc in your working directory, then it should work well. Yeah, if you can show us the relevant part of your Dockerfile, that would help!
In the meantime you can e.g. create an .npmrc file with the contents you’d like
registry = https://my.shiny.registry/
and then in your Dockerfile copy it to the working directory from where you are going to run the npm install. So in simplified way:
COPY .npmrc ./
RUN npm install
Alternatively you can just create the file on the fly with a line like this:
RUN echo "registry = https://my.shiny.registry/" > .npmrc
RUN npm install
I’ve tested it out, and both of these work. I’m guessing that you are not copying the .npmrc file into the container, that’s why it doesn’t find it. The explicit copy should work.
Thanks for your replies. I’m not using my own Docker file, just uploading a plain old node project, and letting resin do it’s thing. I’ll look at writing a Dockerfile to do this.