node.js - npm uninstall 不删除文件

标签 node.js npm uninstallation

我是 nodejs 和 npm 的新手,我想了解如何 npm uninstall有效。

我已经下载并安装了一个模块,其中的代码有点困惑,但现在我想恢复原始版本,所以我做了:

npm uninstall <module>

(我的 node_modules 文件夹中没有更多文件夹)

npm install <module>

但是在安装之后,返回的文件是我之前修改过的文件,而不是原始文件(即使我在安装时看到了来自 GET 的所有 npm 消息)

我也试过npm uninstall --save <module> , 和 npm cache clean , 但结果相同。

我错过了什么?

最佳答案

更新npm,卸载模块,用-f清理缓存,然后重新安装终于成功了!

关于node.js - npm uninstall 不删除文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22144619/

相关文章:

javascript - NodeJs - 如何在呈现的 EJS 中呈现 EJS?

node.js - 运行剑圣时出错

node.js - Npm 安装错误键入 : command not found

powershell - 如何找到已安装的MSI设置的产品GUID?

每次安装使用 msi.exec 打开帮助选项

node.js - 带有 sass-loader 的 Webpack 文件加载器

javascript - 将更新部署到 GitHub 后收到错误 "Cannot find module ' fs/promises'"

node.js - nodejs/npm - 使用 VPN 时包不起作用

angular - 如何使用 Angular CLI 实现 ng2-ui(NPM 包)?

go - 完全删除安装了 "go get"的软件包?