我正在尝试开始使用Next.js,但收到以下错误:
Module build failed: Error: Cannot find module 'react-hot-loader/babel' from '/home/ugurkaya/Desktop'以下是我的package.json:
"name": "hello-next",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"scripts": {
"dev": "next",
"build": "next build",
"start": "next start"
},
"dependencies": {
"next": "^6.0.4-canary.6",
"react": "^16.4.1",
"react-dom": "^16.4.1",
"react-hot-loader": "next"
}当我得到这个错误时,我手动添加了react-hot-loader依赖项,但它没有解决。期待您的帮助!
发布于 2019-03-28 15:48:23
我通过以下方式修复了这个问题
npm install react-hot-loader --save-dev发布于 2020-12-31 12:10:48
生成此问题是因为react在dev依赖项中找不到react-hot-loader
你可以解决这个问题,你只需要安装react-hot-loader作为dev依赖
npm install react-hot-loader --save-devhttps://stackoverflow.com/questions/50869060
复制相似问题