node.jsangular

ng serve: Cannot find module 'tapable'


I just transfered my Angular 5 project from one computer to another and in the new device I get the following error when trying to ng serve:

Cannot find module 'tapable'
Error: Cannot find module 'tapable'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (c:\xampp\node_modules\webpack\lib\Template.js:7:17)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (c:\xampp\node_modules\webpack\lib\node\NodeMainTemplatePlugin.js:5:16)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)

I tried to:

  1. Remove node_modules and run again npm install.
  2. npm install tapable

My node version is 6.11.2 with npm 5.3.

Any idea what can solve it?


Solution

  • Fix: I had to manually npm install webpack in order to solve this issue.