I am installing a package from my private repository. I am able to install it using:
npm i -S git+https://oauth2:[email protected]/mygroup/acl-api.git
I am using docker container but while installation process I am getting an error:
npm ERR! path git
npm ERR! code ENOENT
npm ERR! errno ENOENT
npm ERR! syscall spawn git
npm ERR! enoent Error while executing:
npm ERR! enoent undefined ls-remote -h -t https://oauth2:[email protected]/mygroup/acl-api.git
npm ERR! enoent
npm ERR! enoent
npm ERR! enoent spawn git ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
How can I solve it?
My docker file:
FROM node:alpine
COPY package.json package.json
COPY src src
COPY .babelrc .babelrc
RUN npm install
RUN npm run gitlab-build
RUN ls
EXPOSE 8080
CMD ["npm", "run", "docker-start"]
log into your docker hub account, and go to your global settings. There is a setting that allows you to set what your default visability is for the repositories that you push. By default it is set to public, but if you change it to private, all of your repositories that you push will be marked as private by default.
To install packages in a docker container, the packages should be defined in the Dockerfile. If you want to install packages in the Container, use the RUN statement followed by exact download command . You can update the Dockerfile with latest list of packages at anytime and build again to create new image out of it.
You should add git
and openssh-client
and other packages if you want to the node:alpine
to let npm
pull the repository
FROM node:alpine
RUN apk add --update \
python \
python-dev \
py-pip \
build-base \
git \
openssh-client \
&& pip install virtualenv \
&& rm -rf /var/cache/apk/*
COPY package.json package.json
COPY src src
COPY .babelrc .babelrc
RUN npm install
RUN npm run gitlab-build
RUN ls
EXPOSE 8080
CMD ["npm", "run", "docker-start"]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With