Deno:error: Uncaught (in promise) Error: attempt to write a readonly database: Error code 8: Attempt to write a readonly database

1 min

language: ja bn en es hi pt ru zh-cn zh-tw

Image
大家好,我是無能。
出現了一些錯誤。

背景

在執行deno task *的目錄中,使用chown更改所有權限後發生了這個錯誤。
錯誤

error: Uncaught (in promise) Error: attempt to write a readonly database: Error code 8: Attempt to write a readonly database
  const cache = await caches.open("lume_remote_files");
                             ^
    at CacheStorage.open (ext:deno_cache/01_cache.js:46:27)
    at read (https://deno.land/x/lume@v2.3.3/core/utils/read.ts:59:30)
    at https://deno.land/x/lume@v2.3.3/deps/svg2png.ts:7:20

然後,即使執行ls -la並尋找.cache也找不到,甚至刪除ls -la ~/.cache/deno/ 後,這個錯誤仍然出現...。

解決方法

經過一番研究,Deno 似乎也會在/tmp/deno_cache/中建立快取。這是 RAM 記憶體快取。
這個快取因為所有權問題而產生衝突,導致它說「我不認識你!」
所以,刪除它。

rm -rf /tmp/deno_cache

這樣就解決了!

Related Posts