npm uninstall

删除一个包

概要

npm uninstall [<@scope>/]<pkg>[@<version>]... [-S|--save|--no-save]

aliases: remove, rm, r, un, unlink

描述

这将卸载一个包,完全删除代表它安装的所有 npm。

它还会从 package.json 中的 dependenciesdevDependenciesoptionalDependenciespeerDependencies 对象中删除包。

此外,如果您有 npm-shrinkwrap.jsonpackage-lock.json,npm 也会更新这些文件。

--no-save 会告诉 npm 不要从你的 package.jsonnpm-shrinkwrap.jsonpackage-lock.json 文件中删除包。

ugfejdwpY+ptNiPE8H32M4r8Y/6P668oqr9wpC7N7fdDysN/r3viCG8LwAuf9zBYHiQr0xwqwJVB7QFkyMZFMsdQtzTLNtEyrQmNSVnNxzu2KpZbLigoqwvwUSB15fiqJnekJD0I3nJjWCPCaoXEIeXB7krXblwXCuG9KOkC7EiOuRMaYuEra00lvOeBZ+/WGbPUgRxC+j0PvcEZ7szG121CFAXgx0tnUcrzILxwOlB92hNUrcj+tkDs/1XiXv/NOwqa3bs0bYuzFgSojaM3VzMUPgXVAXJxmUPPo7IEGZdw2qBr565ZnBSMBtB7fsLrZPmT+T311MoMjUq5g2smQnh6OcpORF7ViRN+Nn2tvxTGbOgGfH8kKF4uaC7jzQHKekCd79Cl+hXC9okF/cjkIe/7cezyN2OQdbB3EDS5t8Q=

WmxS43IQV+5PGMo57IVUCG24J3Mry569rFthm9w1MR1uwPANv1wUFkRqwN9btgH1mnmbj6D3p0wHFGRCdyKKx78BzJgse5XLFV9kEHodeG8YdDDk7ix6GqP/W57PoSRMGsPzTYVLswqbKO9eudE+QtrhJaZH0iGZln7iofBe6X8eUeSdG9ZhrOnNeqq6BEE8L6enzL6ccoTwhwRw+DJQo6SEu9CrQt+XLv9b4083v/jE/ZDBH8PT2whPhwhAx1ofwpWriyDkaYAi42ea1SuU6g==

cFhDuMY6INguntVVwCoutylz/k4GZo2ginVjmIJfkbzILBZBEt3n8WJ0FHBJnpTRNfPPIMYqUd5J8VZ3BGUUgARuFvmme49cs1Ty0wWAPLXcGv9O6sprEE1EbdIQwezxfupP38MHtK0zv6sgRF95ovGi+4I2UK6p5Zc0DOFn7zg=

示例

npm uninstall sax

HMJnrKTcH6iQntBQSsnHI4cVMe3xAUcSzU9LEkXxcJYfS5Qi/ZEdJWDvMBlLIYlIwX2vRsj0sbRfyAZaBk/uNjzKhnzJnZMkD+b5sNQ9+ONL+OxtuY2dc/DaUxolIp2bA9l6iQafOMlu52GOWNV0FoU2AE83grLvUT9tZsky/4/MyDhDyKx3d4BmiZVho54/bu/G0eCAjMqa23jWTwGyYg==

npm uninstall lodash --no-save

HYsw5sxldQsh98yBpX28NYjmNlq6Hrhe09kEgJJo5AMr9i+wwy3xLZ/JYdDz3qCF0LQXXYxBN6HONRSnFO1QGdwMzzvvU+xO0DGiHiXHHwnKqrwypKP3HGrBRY26HnNFWuervul/PFbEh2u7No0N/1kyWmSymbH99DorvKpOR30H7Ys4ShtTQqmEKN/UvfGK7VweOfkoJ1yjUTbxKSdGPw==

配置

save

    2x2PgnfhSfn+ndqCKDA2YUv2bwKpELJkslsYor+8CmofBnfMywe2+v3Bz6m4ifl79mY9brIP8GA0qLmYt5xcAg==

/HJvM5ootZrYgtHEm9rXxapY430UdajYKRNqk2F7yj1V9koLayXJS3zYz4glGwufVsnXbBZyZBagU0AmjD/EBd8HZPQNsmQnjlqsposOsB4=

/Qoq9VQ3zyGuPtVyYdXfznbVAhv+bQBJ75/OQZAjEMy00ijvKlHdHfVmnw7kv3fCupFiAL/ce0UDRMKkXZFc/vvtQp5K1zOL8PQnD8ylpiYxi0FYXfwZelmqYT6aRC8A

workspace

    2x2PgnfhSfn+ndqCKDA2YdqjS8n9wpdOD4dC9Qm73CK6l2uR0X+rTya3wI564OdiAO+p0zEyd1BS3Ez63htxlzLOtCsMK9WGqgL0rw7QNcQ=

P3R5veyvPJaEApTD99CbxjJYyzpvgJiaMfhxdEUe3ph7aUA5b0UmjpuSC0x5MlRVUFe+0KhK6NB5md/5e7SOS+EclkGNLNubSkj0FIoS8tZnMbXGw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