Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the meaning of npm init -y

Tags:

npm

init

Please I would love to know the meaning of the flag -y. I noticed it is used in setting up an npm project, but what exactly does it mean?

npm init -y
like image 640
George Foreman Avatar asked Jul 04 '20 04:07

George Foreman


2 Answers

The -y flag when passed to NPM commands tells the generator to use the defaults instead of asking questions.

npm init -y

will simply generate an empty npm project without going through an interactive process.

The -y stands for yes. More about npm-init here

like image 51
sheR Avatar answered Oct 16 '22 02:10

sheR


from npm help init:

   Generate it without having it ask any questions:

     $ npm init -y
like image 37
Evert Avatar answered Oct 16 '22 01:10

Evert