Error: Cannot find module 'webpack/lib/node/NodeTemplatePlugin'

0 votes

Got this Error after running webpack. Webpack is installed globally and I'm running Node

PS D:\Projects\ng2-admin-master> ng serve
Cannot find module 'webpack/lib/node/NodeTemplatePlugin'
Error: Cannot find module 'webpack/lib/node/NodeTemplatePlugin'
    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> (D:\Projects\ng2-admin-master\node_modules\html-webpack-plugin\lib\compiler.js:11:26)
    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> (D:\Projects\ng2-admin-master\node_modules\html-webpack-plugin\index.js:7:21)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
PS D:\Projects\ng2-admin-master>
Apr 22 in Angular by kartik
• 26,540 points
1,674 views

1 answer to this question.

0 votes

Hii kartik,

Removing the node_modules and the package-lock.json and reinstall the packages.

You can run this in PowerShell (make sure you are in the correct working directory):

rm node_modules -r -force
rm package-lock.json
npm cache verify
npm install

Thank You!!

answered Apr 22 by Niroj
• 57,260 points

Related Questions In Angular

0 votes
1 answer

Error: EACCES: permission denied, access '/usr/local/lib/node_modules' react

Hello @kartik, Change your file permissions like this First ...READ MORE

answered Jul 22 in Angular by Niroj
• 57,260 points
654 views
0 votes
1 answer

Error:Cannot read property 'remove' of undefined at BrowserDomAdapter.removeClass

Hello @kartik, There are several ways to add ...READ MORE

answered Sep 8 in Angular by Niroj
• 57,260 points
22 views
0 votes
1 answer

Which module is used for routing in AngularJs?

The ngRoute module helps your application to become a ...READ MORE

answered Feb 4 in Angular by Niroj
• 57,260 points
45 views
0 votes
1 answer

What is meant by passing the variable by value and reference in PHP?

Hello, When the variable is passed as value ...READ MORE

answered Mar 27 in PHP by Niroj
• 57,260 points
113 views
0 votes
1 answer

Connection with MySQL server using PHP. How can we do that?

Hey @kartik, You have to provide MySQL hostname, ...READ MORE

answered Mar 27 in PHP by Niroj
• 57,260 points
80 views
0 votes
1 answer

How to retrieve or obtain data from the MySQL database using PHP?

Hello kartik,  Actually there are many functions that  ...READ MORE

answered Mar 27 in PHP by Niroj
• 57,260 points
90 views
0 votes
1 answer

What are the differences between mysqli_connect and mysqli_pconnect?

Hello, mysqli_pconnect() function is used for making a persistence ...READ MORE

answered Mar 27 in PHP by Niroj
• 57,260 points
220 views
0 votes
1 answer

Error:Uncaught TypeError: Cannot read property 'setState' of undefined

Hello @kartik, This is due to this.delta not being bound ...READ MORE

answered Jun 4 in Angular by Niroj
• 57,260 points
134 views
0 votes
1 answer

Error: Cannot read property 'setState' of undefined

Hello @kartik, This is due to this.delta not being bound ...READ MORE

answered Jul 22 in Angular by Niroj
• 57,260 points
384 views