Home > OS >  npm live server not working on local windows os
npm live server not working on local windows os

Time:10-17

I installed live-server globally using this command:

npm install -g live-server

But when I run live-server public/index.html its not working showing these below erros:

internal/modules/cjs/loader.js:905
  throw err;
  ^

Error: Cannot find module 'C:\Users\sabbi\AppData\Roaming\npm\node_modules\live-server\live-server.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
    at Function.Module._load (internal/modules/cjs/loader.js:746:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

CodePudding user response:

I fixed it with install globally with --force:

npm install -g live-server --force
  • Related