search

Home  >  Q&A  >  body text

node.js - How to write npm install command in node?

When using commander to write commands, you need to use npm install, but you can directly execute it with child_process. As a result, the command line page process is not output. I don’t know the progress of the installation. How to solve this problem?

習慣沉默習慣沉默2797 days ago886

reply all(2)I'll reply

  • typecho

    typecho2017-06-22 11:56:25

    You first make sure you have node installed. Enter the command in cmd: node -v
    If the node version is displayed, it means that node has been installed, and you can directly use the command npm install

    reply
    0
  • 阿神

    阿神2017-06-22 11:56:25

    child_process accepts a configuration parameter. If you check the documentation, you can configure stdio:'inherit', so that the install information will be output to the IO stream of the parent process

    reply
    0
  • Cancelreply