我正在尝试向我的 Gatsby 网站添加一个博客,其中涉及添加 MDX 支持。当我尝试通过运行以下命令安装MDX 插件时,出现以下错误:
命令
npm install gatsby-plugin-mdx @mdx-js/mdx@v1 @mdx-js/react@v1
错误
E:\Dev\Web\dantcho.com>npm install gatsby-plugin-mdx @mdx-js/mdx@v1 @mdx-js/react@v1
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: dantcho@1.0.0
npm ERR! Found: react@18.2.0
npm ERR! node_modules/react
npm ERR! react@"^18.2.0" from the root project
npm ERR! peer react@"^16.9.0 || ^17.0.0 || ^18.0.0" from gatsby-plugin-mdx@3.16.1
npm ERR! node_modules/gatsby-plugin-mdx
npm ERR! gatsby-plugin-mdx@"*" from the root project
npm ERR!
npm ERR! Could not resolve …Run Code Online (Sandbox Code Playgroud)