How can I pass 'yes' response when npm installing on Dockerfile How can I pass 'yes' response when npm installing on Dockerfile docker docker

How can I pass 'yes' response when npm installing on Dockerfile


I used the following to install Angular without usage statistics sharing.

RUN echo n | npm install -g --silent @angular/cli

I think echo y should work for you


There's the yes command specifically for this in linux:

RUN yes | npm install something && \    npm install something && \    yes yes | npm install something 

The first line outputs a list of "y" to the first npm install command. The yes command also takes an option of what you want it to output. So if you need to output "yes" instead of a single "y" character per line, then you can run yes yes as seen in the third example.