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

后端 未结 10 2399
陌清茗
陌清茗 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:45

    Most of the time I use the following command to achieve a complete reinstall of all the node modules (be sure you are in the project folder).

    rm -rf node_modules && npm install
    

    You can also run npm cache clean after removing the node_modules folder to be sure there aren't any cached dependencies.

提交回复
热议问题