How To Fix npm Err! Tracker “idealTree” already exists

If you are building a docker image and have commands to run npm update or npm install command previously with no errors if you try to run the same build again you might run this error as there is an update to how Node works starting with version 15.

With Node version 15 and higher a WORKDIR needs to be specified else it would try to run the root directory. A quick fix is to create a WORKDIR in your Dockerfile.

FROM node:alpine

#Install some dependencies

WORKDIR /usr/app
COPY ./ ./

# Install base dependencies
RUN apk add git
RUN npm update
RUN npm install sfdx-cli -g

3 thoughts on “How To Fix npm Err! Tracker “idealTree” already exists

Leave a Reply

Your email address will not be published. Required fields are marked *