title: How to execute the command NPM init in the nodejs file
body: <p>How to execute the command <code>npm init</code> in the nodejs file? I want to use <code>node. / index.js</code> to execute the command. But what should I do if the command interacts with the user?</p>
  <p>This code is directly stuck, and the subsequent question and answer cannot be carried out.I hope users can fill in the information normally</p>
  <pre><code>let exec = require('child_process').exec;
  exec(&quot;npm init&quot;)
  </code></pre>