【问题标题】:npm data storage issuenpm 数据存储问题
【发布时间】:2018-04-22 21:51:13
【问题描述】:

我在这里遇到了一个奇怪的问题,因此我删除了 C 驱动器上的大部分 npm 软件包,因为我将它们全部移动到我的外部硬盘驱动器上。我决定这样做是因为我意识到无论何时我要全局安装一个包,即使我更改了前缀,它也会始终将它安装在我的 C 驱动器上。

无论如何,在设置我的前缀并删除我的 C 驱动器上与 npm 相关的所有文件之后,我仍然有超过 100 gig 的数据应该可用。

为什么 npm 获取了这么多数据?仅我的节目就只有几场演出。

所以我很困惑为什么。我有 Windows 8。

编辑

C:\Users\Niloy>npm cache clean
npm ERR! As of npm@5, the npm cache self-heals from corruption issues and 
data extracted from the cache is guaranteed to be valid. If you want to make 
sure everything is consistent,
use 'npm cache verify' instead.
npm ERR!
npm ERR! If you're sure you want to delete the entire cache, rerun this 
command with --force.

npm ERR! A complete log of this run can be found in:
npm ERR!     H:\node.js\npm-cache\_logs\2017-11-09T19_16_27_483Z-debug.log

也使用

npm cache verify
C:\Users\Niloy>npm cache verify
Cache verified and compressed (H:\node.js\npm-cache\_cacache):
Content verified: 0 (0 bytes)
Index entries: 0
Finished in 0.516s

【问题讨论】:

  • TreeSize 这样的实用程序有帮助吗?
  • 我没有,但我设法通过在他们的文件资源管理器上放置一些窗口代码来找到我最大的文件,结果证明这根本不是 npm 问题,我认为这是因为我前一天使用它,但它是 Windows 8.1 安装(最近重新启动了我的笔记本电脑。)非常感谢您提供的信息。

标签: node.js windows npm


【解决方案1】:

使用npm cache clean 清除%AppData%\npm。使用npm config set cache D:\Devel\nodejs\npm-cache --global 将您的缓存位置移动到外部驱动器,如另一个answer 中所述。

【讨论】:

  • 我实际上创建了一个新的缓存位置并移动到我的外部硬盘驱动器并删除了我电脑上的那个。虽然我之前没有使用 npm cache clean,但是当我这样做时,我遇到了一个错误,我会在我的问题上发布错误,以便每个人都能得到更好的看法。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2021-04-02
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-11-05
  • 2011-11-09
  • 2023-04-10
相关资源
最近更新 更多