After upgrading to 1.4.5 (Windows 10, Node 8.6.0) and running ng serve I get this error:
Cannot find module 'webpack/lib/node/NodeTemplatePlugin'
I rebooted my machine, reinstalled all npm packages, nothing helps.
Basically, this is a blocking issue.
Same problem here... ( but MacOS ).
"dependencies": {
"@angular/animations": "^4.4.4",
"@angular/cdk": "^2.0.0-beta.12",
"@angular/common": "^4.4.4",
"@angular/compiler": "^4.4.4",
"@angular/core": "^4.4.4",
"@angular/flex-layout": "^2.0.0-beta.9",
"@angular/forms": "^4.4.4",
"@angular/http": "^4.4.4",
"@angular/material": "^2.0.0-beta.12",
"@angular/platform-browser": "^4.4.4",
"@angular/platform-browser-dynamic": "^4.4.4",
"@angular/router": "^4.4.4",
"ack-angular-webcam": "^1.3.12",
"core-js": "^2.4.1",
"material-design-icons": "^3.0.1",
"roboto-fontface": "^0.8.0",
"rxjs": "^5.4.2",
"zone.js": "^0.8.18"
},
"devDependencies": {
"@angular/cli": "^1.4.5",
"@angular/compiler-cli": "^4.4.4",
"@angular/language-service": "^4.4.4",
"@types/jasmine": "~2.5.53",
"@types/jasminewd2": "~2.0.2",
"@types/node": "^6.0.89",
"codelyzer": "~3.1.1",
"jasmine-core": "~2.6.2",
"jasmine-spec-reporter": "~4.1.0",
"karma": "~1.7.0",
"karma-chrome-launcher": "~2.1.1",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.1.2",
"ts-node": "~3.2.0",
"tslint": "^5.7.0",
"typescript": "~2.3.3"
}
npm i
npm WARN [email protected] requires a peer of webpack@^3.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of webpack@1 || ^2 || ^2.1.0-beta || ^2.2.0-rc || ^3 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of webpack@^2.0.0 || ^3.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of webpack@^2.0.0 || >= 3.0.0-rc.0 || ^3.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of webpack@^1.9 || ^2 || ^2.1.0-beta || ^2.2.0-rc || ^3.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of webpack@^1.0.0 || ^2.0.0 || ^3.0.0 but none is installed. You must install peer dependencies yourself.
I also deleted the node_modules folder and ran npm i again.
I'm build a web.app using angular-cli, angular material and angular flexlayout.
ok, I downgraded NPM to 5.3.0, reinstall CLI and now everything works.
Finally I got it.
It was not angular Cli itself. I had to clear the browsercache the hard way... and hat to recognize the delta between the latest angular material 2 release ( Beta 12 ) and the docs... :(
@goeranhomberg , not sure I understand your solution. are you still on 1.4.5?
@alvipeo yep... I figured out that updating Angular CLI and Angular Material 2 at the same time can mix up some things and lead you to some missunderstandings.
My solution for both was to follow the CLI update instructions ( including npm cache clean --force ) and deleting my browsers cache. After this I completely removed all components containing angular material 2 stuff and my app was alive again.
To round things up I had to find out that the angular material 2 docs are not up to date with some braking changes they made.
After going through these pitfalls everything's good again (see Material2 Issue ).
I had the same issue but on our CI. I downgraded the CLI from 1.4.5 to 1.4.4 and that fixed my issue
@goeranhomberg I don't even have Material in my project. so you have something else. And I did cache clean too, that didn't help. Just downgrading NPM helped.
Hi @alvipeo,
This is a problem with NPM. Which NPM version are you using?
You're missing webpack in your node_modules folder. No idea why without further investigation, but I cannot reproduce on my computer.
it was npm 5.4.1. Haven't tried 5.4.2 yet. Will try today
Same problem here, I was in 5.4.2 and downgrade NPM to 5.3.0 and didn't help. My application is almost completely built with Material 2 and I can not remove the components.
I'm very lost at this moment.
hi guys, maybe try deleting node_modules & package-lock.json files. at least i solve the problem.
For me this solved the problem after deleting node_modules and installing again with nmp install
npm remove webpack -g
npm i webpack --save-dev
npm run webpack
For me, the problem was the webpack globally installed. When I deleted it, a-cli worked. I think that a-cli was looking for some files globally which they weren't installed.
same think happened to me today when I tried to upgrade from 1.4.7=>1.4.8
node_modules/webpack/* is missing after this upgrade and warning like this appears:
npm WARN @ngtools/[email protected] requires a peer of webpack@^2.2.0 || ^3.0.0 but none is installed. You must install peer dependencies yourself.
I have MacOS and [email protected]
I also just had this issue after upgrading angular-cli from 1.4.4 to 1.4.8 and angular (and related libraries) from 4.4.4 to 4.4.6 and also upgrading npm from 5.4.2 to 5.5.1.
This proved to be the gazillionth time that this relatively newly introduced package-lock.json is screwing things up for me. I deleted this file and the node_modules folder, ran npm install and everything works now without any downgrades or version changes.
after doing :
remove node_modules
remove package-lock.json
npm cache clean -f
works again for me!
having the same problem Cannot find module 'webpack/lib/node/NodeTemplatePlugin'
For me last working version of @angular/cli was 1.5.0-rc.2 RC3 -> RC8 doesn't work.
npm --version: 5.5.1
node modules are installed correctly.
update: Install webpack as a devDependency. Fixed for me.
Have the same problem, on macOS 10.12.6.
NG Cli: 1.5.0, Node 8.9.0 (LTS), NPM 5.5.1
Have used CLI 1.4.9 for weeks without a problem.
Created a new project with CLI 1.5.0, carried over all changes in packages.json, .angular-cli.json, src/polyfills.ts to the project which initially was created with CLI 1.4.0 I believe.
Have upgraded it gradually up to 1.4.9, it has worked nicely.
@istiti has given a valuable advise, it has worked for me.
@istiti thanks!
removing node_modules and package-lock.json then reinstalling fixed things.
I just came here having the same problem and I solved as @istiti said.
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
_This action has been performed automatically by a bot._
Most helpful comment
after doing :
works again for me!