2
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?

「[CLI.INIT_INSTALL_FAILED] Failed to install dependencies why: pnpm exited with code 1.」の解決方法【Prisma】

2
Posted at

はじめに

Prismaをインストールしたらエラーが発生しました。

問題

実行したコマンド

npx prisma@latest orm init --yes --target postgres --authoring psl --write-env

エラー内容(一部抜粋)

Error: ERR_PNPM_IGNORED_BUILDS

  × adding a new package
  ╰─▶ Ignored build scripts: workerd@1.20260901.1
  help: Run "pnpm approve-builds" to pick which dependencies should be allowed to run scripts.

✘ pnpm add -D prisma@latest
│  target:     postgres
│  authoring:  psl
│  schema:     src/prisma/contract.prisma

✘ [CLI.INIT_INSTALL_FAILED] Failed to install dependencies
  why: pnpm exited with code 1.
→ Run the install yourself: pnpm add -D prisma@latest
→ Emit the contract once the dependencies are installed: prisma contract emit
  docs: https://docs.prisma.io/docs/orm/v8/reference/error-reference#CLI.INIT_INSTALL_FAILED
Prisma agent skills are out of date (installed @prisma/orm-postgres 8.0.0-rc.14, synced none). Run: prisma skills sync

解決方法

npmを使う場合

npm install -D prisma@latest

pnpmを使う場合

スクリプト実行を許可する

pnpm approve-builds

おわりに

Prismaをインストールしたら勝手にpnpmコマンドが走り、スクリプトの実行が許可されずエラーが起きたようです。
普段npmを使っているのでnpmで該当パッケージをインストールしなおしました。

2
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
2
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?