Open1

(node:137) ExperimentalWarning: CommonJS module ... is loading ES Module ... using require().

aobaaoba

エラーログ全文

npx prisma initを実行したときに以下のエラーが発生した。

root@43421b6a756a:/app# npx prisma init --datasource-provider postgresql
(node:137) ExperimentalWarning: CommonJS module /usr/local/lib/node_modules/npm/node_modules/debug/src/node.js is loading ES Module /usr/local/lib/node_modules/npm/node_modules/supports-color/index.js using require().
Support for loading ES Module in require() is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
Error: (0 , CSe.isError) is not a function

解決方法

ベースイメージのnodeのバージョンを一つ下げることで解決した。

- FROM node:23
+ FROM node:22