I am trying to get started with Next.js, yet I receive the following error:
Module build failed: Error: Cannot find module 'react-hot-loader/babel' from '/home/ugurkaya/Desktop'
The following is my 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. Looking forward your helps!
I am trying to get started with Next.js, yet I receive the following error:
Module build failed: Error: Cannot find module 'react-hot-loader/babel' from '/home/ugurkaya/Desktop'
The following is my 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. Looking forward your helps!
2 Answers
Reset to default 3I fixed this issue by just
npm install react-hot-loader --save-dev
This issue is generate because react not find react-hot-loader in dev dependancy
You can solve this problem you just need to install react-hot-loader as dev dependancy
npm install react-hot-loader --save-dev
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745439991a4627786.html
评论列表(0条)