[英]Next.js: Module build failed: Error: Cannot find module 'react-hot-loader/babel' from '/home/ugurkaya/Desktop'
I am trying to get started with Next.js, yet I receive the following error:我正在尝试开始使用 Next.js,但收到以下错误:
Module build failed: Error: Cannot find module 'react-hot-loader/babel' from '/home/ugurkaya/Desktop'
The following is my package.json:以下是我的 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"
}
I added the react-hot-loader
dependency manually when I get this error, yet it did not solve.当我收到此错误时,我手动添加了
react-hot-loader
依赖项,但它没有解决。 Looking forward your helps!期待您的帮助!
我解决了这个问题
npm install react-hot-loader --save-dev
This issue is generate because react not find react-hot-loader in dev dependancy生成此问题是因为 react 在 dev 依赖项中找不到 react-hot-loader
You can solve this problem you just need to install react-hot-loader as dev dependancy你可以解决这个问题,你只需要安装 react-hot-loader 作为开发依赖
npm install react-hot-loader --save-dev
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.