I just picked up a new book, Fullstack React and when trying to run the example app, I am getting the error of module not found. The modules in question are apparently live-server. Here’s the error message. I’ve done npm install before npm run server and no luck
> live-server public --host=localhost --port=3000 --middleware=./disable-browser-cache.js
internal/modules/cjs/loader.js:892
throw err;
^
Error: Cannot find module './disable-browser-cache.js'
Require stack:
- C:UsersSuleymanAppDataRoamingnpmnode_moduleslive-serverindex.js
- C:UsersSuleymanAppDataRoamingnpmnode_moduleslive-serverlive-server.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)
at Function.Module._load (internal/modules/cjs/loader.js:745:27)
at Module.require (internal/modules/cjs/loader.js:961:19)
at require (internal/modules/cjs/helpers.js:92:18)
at C:UsersSuleymanAppDataRoamingnpmnode_moduleslive-serverindex.js:189:10
at Array.map (<anonymous>)
at Object.LiveServer.start (C:UsersSuleymanAppDataRoamingnpmnode_moduleslive-serverindex.js:183:13)
at Object.<anonymous> (C:UsersSuleymanAppDataRoamingnpmnode_moduleslive-serverlive-server.js:174:12)
at Module._compile (internal/modules/cjs/loader.js:1072:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\Users\Suleyman\AppData\Roaming\npm\node_modules\live-server\index.js',
'C:\Users\Suleyman\AppData\Roaming\npm\node_modules\live-server\live-server.js'
]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] server: `live-server public --host=localhost --port=3000 --middleware=./disable-browser-cache.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] server script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:UsersSuleymanAppDataRoamingnpm-cache_logs2022-03-29T07_43_25_808Z-debug.log
PS C:UsersSuleymanDownloadsfullstack-react-masterfullstack-react-mastervoting_app> ```