我正在尝试根据文档https://www.gatsbyjs.com/plugins/gatsby-plugin-image#installation通过 npm 安装 gatsby-plugin-image
在终端中收到以下错误:
$ npm install gatsby-plugin-image gatsby-plugin-sharp gatsby-source-filesystem gatsby-transformer-sharp
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: gatsby-starter-hello-world@0.1.0
npm ERR! Found: gatsby@2.32.9
npm ERR! node_modules/gatsby
npm ERR! gatsby@"^2.26.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer gatsby@"^3.0.0-next.0" from gatsby-plugin-image@1.0.0
npm ERR! node_modules/gatsby-plugin-image
npm ERR! gatsby-plugin-image@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 Material UI 创建一个基本的导航栏。Material-UI 文档站点https://material-ui.com/components/app-bar/上的样板模板在浏览器中返回以下错误:
“尝试导入错误:‘@material-ui/icons’不包含默认导出(导入为“MenuIcon”)。”
我已经使用 npm 安装了 @material-ui/core 和 @material-ui/icons。参见 package.json:
{
"name": "profile_v4",
"version": "0.1.0",
"private": true,
"dependencies": {
"@material-ui/core": "^4.11.2",
"@material-ui/icons": "^4.11.2",
"@testing-library/jest-dom": "^5.11.8",
"@testing-library/react": "^11.2.2",
"@testing-library/user-event": "^12.6.0",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-router-dom": "^5.2.0",
"react-scripts": "4.0.1",
"web-vitals": "^0.2.4"
},
Run Code Online (Sandbox Code Playgroud)
我的 Navbar.js 组件文件:
import React from 'react'
import { AppBar, Toolbar, IconButton, Typography, Button } from '@material-ui/core';
import MenuIcon from "@material-ui/icons";
const Navbar = () => {
return (
<AppBar position="static">
<Toolbar>
<IconButton edge="start" className={classes.menuButton} …Run Code Online (Sandbox Code Playgroud)