1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

CIで「import { formatWithOptions, styleText } from "node:util";SyntaxError: The requested module 'node:util' does not provide an export named 'styleText'」が出た

1
Posted at

はじめに

GitHub Actionsでnpx vitest実行中にエラーが起きた

問題

file:///home/runner/work/kadai5/kadai5/node_modules/vite/node_modules/rolldown/dist/shared/rolldown-build-DSxL8qiP.mjs:9
import { formatWithOptions, styleText } from "node:util";
                            ^^^^^^^^^
SyntaxError: The requested module 'node:util' does not provide an export named 'styleText'
    at ModuleJob._instantiate (node:internal/modules/esm/module_job:123:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:191:5)
    at async ModuleLoader.import (node:internal/modules/esm/loader:337:24)
    at async start (file:///home/runner/work/kadai5/kadai5/node_modules/vitest/dist/chunks/cac.DJJmV0dT.js:2339:27)

node v18はstyleTextをサポートしていなく、エラーが起きていました。

解決方法

nodeのバージョンをv22にする

おわりに

何も考えずにバージョンを設定していた、次からは新しめなやつを使うようにしよう

参考文献

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?