Home  >  Q&A  >  body text

javascript - How to automatically install packages based on package.json

What I got now is a project without node_modules, but with package.json in it. How can I restore node_modules based on this file??

三叔三叔2670 days ago667

reply all(3)I'll reply

  • phpcn_u1582

    phpcn_u15822017-06-28 09:28:58

    Just Run This On Your Terminal

    npm install 

    reply
    0
  • PHP中文网

    PHP中文网2017-06-28 09:28:58

    npm install

    reply
    0
  • PHP中文网

    PHP中文网2017-06-28 09:28:58

    Open the command line in your project directory and execute npm installThe node_modules file will be automatically generated.
    But now I usually use cnpm (Taobao mirror), which makes the installation faster.
    If you want to use cnpm to install, first execute npm install -g cnpm --registry=https://registry.npm.taobao.org
    Then run cnpm install

    reply
    0
  • Cancelreply