I’m trying to Balena push my application to a production environment but the build keeps failing. It’s the exact same repo as was successfully deployed a week ago.
Errors are as follows:
Removing intermediate container fc73b93c08ed
—> 1c1979adf5a4
Step 8/17 : RUN npm install -g yarn typescript
—> Running in 6e792b169a1e
/usr/local/bin/tsc -> /usr/local/lib/node_modules/typescript/bin/tsc
/usr/local/bin/tsserver -> /usr/local/lib/node_modules/typescript/bin/tsserver
npm ERR! code
EEXIST
npm ERR! syscall symlink
npm ERR!
path
../lib/node_modules/yarn/bin/yarn.js
npm
ERR!
dest /usr/local/bin/yarn
npm
ERR! errno -17
npm ERR!
EEXIST: file already exists, symlink '../lib/node_modules/yarn/bin/yarn.js' -> '/usr/local/bin/yarn'
npm ERR! File exists: /usr/local/bin/yarn
npm
ERR!
Remove the existing file and try again, or run npm
npm
ERR! with --force to overwrite files recklessly.
npm
ERR!
A complete log of this run can be found in:
npm
ERR!
/root/.npm/_logs/2020-01-07T22_43_32_361Z-debug.log
I’ve tried updating the FROM base image in the docker file, but errors persist.
Dockerfile is as follows:
FROM balenalib/raspberrypi3-node:10-run-20191122
# Arguments - docker-compose can override them on build and run
RUN apt-get update && apt-get install -yq \
python build-essential && \
apt-get install -y curl && \
apt-get clean && rm -rf /var/lib/apt/lists/*
# NPM token for private packages
ARG NPM_TOKEN
ENV VERSION=1.0.6
# We only want warnings from NPM
ENV NPM_CONFIG_LOGLEVEL warn
RUN npm install -g yarn
# Set a working directory
WORKDIR /app
# Copies the package.json first for better cache on later pushes
COPY package.json package.json
# Copy the app
COPY . /app
# Install the packages
RUN yarn install --force --frozen-lockfile
RUN yarn build
# ───────────────────────────────── Command ──────────────────────────────────
CMD ["yarn","start"]