gatsby の tutorial をやっていたら、npm install → npm audit fix でエラーが出た。
% npm audit fix npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! Found: type-fest@0.20.2 npm ERR! node_modules/type-fest npm ERR! type-fest@"^0.20.2" from globals@13.15.0 npm ERR! node_modules/@eslint/eslintrc/node_modules/globals npm ERR! globals@"^13.9.0" from @eslint/eslintrc@0.4.3 npm ERR! node_modules/@eslint/eslintrc npm ERR! @eslint/eslintrc@"^0.4.3" from eslint@7.32.0 npm ERR! node_modules/eslint npm ERR! peer eslint@"^7.5.0 || ^8.0.0" from @babel/eslint-parser@7.18.2 npm ERR! node_modules/@babel/eslint-parser npm ERR! 13 more (@typescript-eslint/eslint-plugin, ...) npm ERR! type-fest@"^0.20.2" from globals@13.15.0 npm ERR! node_modules/@parcel/packager-js/node_modules/globals npm ERR! globals@"^13.2.0" from @parcel/packager-js@2.6.0 npm ERR! node_modules/@parcel/packager-js npm ERR! @parcel/packager-js@"2.6.0" from gatsby-parcel-config@0.8.0 npm ERR! node_modules/gatsby-parcel-config npm ERR! gatsby-parcel-config@"0.8.0" from gatsby@4.17.2 npm ERR! node_modules/gatsby npm ERR! 2 more (boxen, globals) npm ERR! npm ERR! Could not resolve dependency: npm ERR! peerOptional type-fest@"^0.13.1" from @pmmmwh/react-refresh-webpack-plugin@0.4.3 npm ERR! node_modules/@pmmmwh/react-refresh-webpack-plugin npm ERR! @pmmmwh/react-refresh-webpack-plugin@"^0.4.3" from gatsby@4.17.2 npm ERR! node_modules/gatsby npm ERR! gatsby@"^4.17.1" from the root project npm ERR! 4 more (babel-plugin-remove-graphql-queries, ...) npm ERR! npm ERR! Fix the upstream dependency conflict, or retry npm ERR! this command with --force, or --legacy-peer-deps npm ERR! to accept an incorrect (and potentially broken) dependency resolution. npm ERR! npm ERR! See /Users/i/.npm/eresolve-report.txt for a full report. npm ERR! A complete log of this run can be found in: npm ERR! /Users/i/.npm/_logs/2022-07-03T13_32_10_377Z-debug.log
結局これだった...
yarn 使うと治る(というか回避できる)