How docker container is running a npm script without installing the node-js before?

The docker file below it builds just fine, but how it runs the "npm install" without installing the nodejs and npm before as a dependency?

FROM node:lts-alpine

# Install dependencies
RUN apk add make gcc g++ python bash git curl

# Install packages
RUN npm install

EXPOSE 5000

CMD [ "npm", "start"]

In my opinion, the above script should be written like the one below to be able to build successfully. Both of them are correct. Why? At building time I noticed also the info message "Executing busybox-1.31.1-r9.trigger". What is this exactly and what its purpose?

FROM node:lts-alpine

# Install dependencies
RUN apk add make gcc g++ python bash git curl nodejs npm

# Install packages
RUN npm install

EXPOSE 5000

CMD [ "npm", "start"]

Source: Docker Questions