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

お題は不問!Qiita Engineer Festa 2024で記事投稿!
Qiita Engineer Festa20242024年7月17日まで開催中!

Nuxt3のplaygroundをローカルで起動しようとしたら「ERROR: Cannot find module @nuxt/kit」が発生

Last updated at Posted at 2024-06-16

はじめに

Nuxt3の中身をいじって確認したいことがあったので、クローンしてplaygroundを起動しようとしたら少し詰まりました。戒めの備忘録です。

発生したエラー

contributionのガイドを見つつ、
pnpm installを終え、playgroundを起動しようとしたら下記のエラーが発生。

shell
sample@MacBook-Air-3 nuxt % pnpm dev       

> nuxt-framework@ dev /Users/sample/nuxt
> pnpm play


> nuxt-framework@ play /Users/sample/nuxt
> nuxi dev playground

Nuxt 3.12.1 with Nitro 2.9.6                                                                                                                                                                          18:12:34

[18:12:34]  ERROR  Cannot find module @nuxt/kit imported from file:///Users/sample/nuxt/playground, file:///Users/sample/nuxt/, file:///Users/sample/nuxt/playground/_index.js, file:///Users/sample/nuxt/node_modules

  at _resolve (node_modules/.pnpm/nuxi@3.12.0/node_modules/nuxi/dist/shared/nuxi.b4f7d829.mjs:7998:19)
  at resolveSync (node_modules/.pnpm/nuxi@3.12.0/node_modules/nuxi/dist/shared/nuxi.b4f7d829.mjs:8007:10)
  at resolvePathSync (node_modules/.pnpm/nuxi@3.12.0/node_modules/nuxi/dist/shared/nuxi.b4f7d829.mjs:8010:24)
  at resolvePath (node_modules/.pnpm/nuxi@3.12.0/node_modules/nuxi/dist/shared/nuxi.b4f7d829.mjs:8014:28)
  at importModule (node_modules/.pnpm/nuxi@3.12.0/node_modules/nuxi/dist/shared/nuxi.b4f7d829.mjs:8055:30)
  at loadKit (node_modules/.pnpm/nuxi@3.12.0/node_modules/nuxi/dist/shared/nuxi.a5b1f4d1.mjs:2430:21)
  at async Object.run (node_modules/.pnpm/nuxi@3.12.0/node_modules/nuxi/dist/chunks/dev.mjs:166:32)
  at async runCommand$1 (node_modules/.pnpm/nuxi@3.12.0/node_modules/nuxi/dist/shared/nuxi.6aad497e.mjs:1648:16)
  at async runCommand$1 (node_modules/.pnpm/nuxi@3.12.0/node_modules/nuxi/dist/shared/nuxi.6aad497e.mjs:1639:11)
  at async runMain$1 (node_modules/.pnpm/nuxi@3.12.0/node_modules/nuxi/dist/shared/nuxi.6aad497e.mjs:1777:7) 



[18:12:34]  ERROR  Cannot find module @nuxt/kit imported from file:///Users/sample/nuxt/playground, file:///Users/sample/nuxt/, file:///Users/sample/nuxt/playground/_index.js, file:///Users/sample/nuxt/node_modules

 ELIFECYCLE  Command failed with exit code 1.
 ELIFECYCLE  Command failed with exit code 1.

解決策

ちゃんとplayground用のドキュメントがありました。
(https://nuxt.com/docs/community/framework-contribution)

下記コマンドの実行が足りていなかったので、実行したらエラーは解消されました。

sample@MacBook-Air-3 nuxt % pnpm dev:prepare
0
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
0
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?