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, 2020 in Angular by kartik
• 37,510 points
15,334 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, 2020 by Niroj
• 82,880 points

Related Questions In Angular

0 votes
2 answers

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, 2020 in Angular by Niroj
• 82,880 points
22,061 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, 2020 in Angular by Niroj
• 82,880 points
3,152 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, 2020 in Angular by Niroj
• 82,880 points
976 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, 2020 in PHP by Niroj
• 82,880 points
2,947 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, 2020 in PHP by Niroj
• 82,880 points
999 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, 2020 in PHP by Niroj
• 82,880 points
3,017 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, 2020 in PHP by Niroj
• 82,880 points
3,328 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, 2020 in Angular by Niroj
• 82,880 points
1,051 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, 2020 in Angular by Niroj
• 82,880 points
3,083 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP