Automatically remove dependencies from package.json when using npm uninstall

前端 未结 2 591
野趣味
野趣味 2021-01-30 19:47

After npm init I can add dependencies in my package.json using this:

npm install package --save

And say, I want to uninstall

2条回答
  •  醉话见心
    2021-01-30 19:57

    Use the same --save flag. If you installed a dependency with:

    $> npm install grunt-cli --save
    

    you can uninstall it, with package.json getting updated, using:

    $> npm uninstall grunt-cli --save
    

    The 'save' flag tells npm to update package.json based on the operation you just made it do.

提交回复
热议问题