How do you reinstall an app's dependencies using npm?

后端 未结 10 2410
陌清茗
陌清茗 2020-12-07 07:22

Is there a simple way to reinstall all packages that my app depends on (i.e. they are in my apps node_modules folder)?

10条回答
  •  孤街浪徒
    2020-12-07 07:54

    You can use the reinstall module found in npm.

    After installing it, you can use the following command:

    reinstall
    

    The only difference with manually removing node_modules folder and making npm install is that this command automatically clear npm's cache. So, you can get three steps in one command.

    upd: npx reinstall is a way to run this command without globally installing package (only for npm5+)

提交回复
热议问题