Answer the question
In order to leave comments, you need to log in
Bug in NextTS and React?
The module 'react' was not found. Next.js requires that you include it in 'dependencies' of your 'package.json'. To add it, run 'npm install --save react'
The module 'react-dom' was not found. Next.js requires that you include it in 'dependencies' of your 'package.json'. To add it, run 'npm install --save react-dom'
internal/modules/cjs/loader.js:797
throw err;
^
Error: Cannot find module 'react'
Require stack:
- C:\Users\User\AppData\Roaming\npm\node_modules\next\dist\bin\next
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:794:15)
at Function.Module._load (internal/modules/cjs/loader.js:687:27)
at Module.require (internal/modules/cjs/loader.js:849:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (C:\Users\User\AppData\Roaming\npm\node_modules\next\dist\bin\next:29:13)
at Module._compile (internal/modules/cjs/loader.js:956:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
at Module.load (internal/modules/cjs/loader.js:812:32)
at Function.Module._load (internal/modules/cjs/loader.js:724:14)
at Function.Module.runMain (internal/modules/cjs/loader.js:1025:10) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\\Users\\User\\AppData\\Roaming\\npm\\node_modules\\next\\dist\\bin\\next'
]
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question