{
  "$type": "site.standard.document",
  "canonicalUrl": "https://blog.nove-b.dev//posts/install-nuxt3",
  "description": "仕事でNuxt3を使うことになったので、Nuxt3をインストールする",
  "path": "/posts/install-nuxt3",
  "publishedAt": "2024-02-13T14:18:27.000Z",
  "site": "at://did:plc:2atly2y5kfyjcj5zap6pv4wd/site.standard.publication/3mmxeqr2tcb2k",
  "tags": [
    "Nuxt3"
  ],
  "textContent": "環境\n\n- windws11\n- node => v20.11.0\n- npm => 10.4.0\n- nuxt => 3.10.1\n\n---\n\ninstall\n\n公式の手順に従っていく。\n\nInstallation · Get Started with Nuxt\n\n上記を実行すると、エラーが発生した。\n\nnpm ERR! gyp ERR! cwd C:~\\node_modules\\@parcel\\watcher\n\nエラーを見てみると@parcel\\watcher あたりが怪しい気がする。\n\n@parcel/watcherはどうやらファイルの監視を行うnpmパッケージらしい。オプションで設定ができるようにNuxt3に標準装備されているっぽい。\n\n> Set an alternative watcher that will be used as the watching service for Nuxt.\n> Nuxt uses chokidar-granular by default, which will ignore top-level\n> directories (like node_modules and .git) that are excluded from watching. You\n> can set this instead to parcel to use @parcel/watcher, which may improve\n> performance in large projects or on Windows platforms. You can also set this\n> to chokidar to watch all files in your source directory.\n>\n> https://nuxt.com/docs/guide/going-further/experimental-features#watcher\n\n> Nuxt のウォッチングサービスとして使用される代替のウォッチャーを設定します。Nuxt はデフォルトで chokidar-granular を使用しており、ウォッチから除外されたトップレベルのディレクトリ(node_modules や .git など)を無視します。代わりに @parcel/watcher を使用するようにこれを設定することができます。これにより、大規模なプロジェクトや Windows プラットフォームでのパフォーマンスが向上する場合があります。また、ソースディレクトリ内のすべてのファイルをウォッチするようにこれを chokidar に設定することもできます。\n\nこの時点で何も気にせずにnpm installをしていたら問題なく起動していたかもしれないけど、試してないのでわからない。\n\n「エラーが出た、気になる」ということで検索してみると、\n\nrunning into errors installing Nuxt3\nInint nuxt 3 project fails with npm package\n\n同様のエラーに遭遇しているひとも結構いるっぽい。\n\n解決方法\n\n大本営のリポジトリでも、Unable to install with command failed sh -c node-gyp rebuildのようにissue標記されているが、Nuxtの問題じゃないと言われている。で、その上の過程Unable to install with command failed sh -c node-gyp rebuildでもプルリクが出されている。\n\nで、色々たらい回しされ、Unable to install with command failed sh -c node-gyp rebuildで、\n\n> If you add the following to package.json then do a clean install does it work?\n>\n> \"overrides\": { \"@parcel/watcher\": \"2.1.0\" },\n\nという希望が示されていたので、実行してみた。\n\nインストールも成功し、\n\nで無事にサーバーも起動した。\n\nなんとなく気分の良くないインストール体験だった。\n\nReact主義だけど、より一層React主義になった。開発体験で挽回してくれることに期待している。\n\n---",
  "title": "Install Nuxt3 | ERR! @parcel watcher"
}