_                      _                 ____ _     ___
   / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
  / â–³ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
 / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
/_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
               |___/
Angular CLI: 1.6.6
Node: 6.11.2
OS: win32 x64
Angular: 5.2.2
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router
@angular/cli: 1.6.6
@angular-devkit/build-optimizer: 0.0.42
@angular-devkit/core: 0.0.29
@angular-devkit/schematics: 0.0.52
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.6
@schematics/angular: 0.1.17
typescript: 2.5.3
webpack: 3.10.0
 ng serve
Cannot find module 'uglifyjs-webpack-plugin'
Error: Cannot find module 'uglifyjs-webpack-plugin'
    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:\sample\node_modules\@angular\cli\models\webpack-configs\production.js:13:24)
    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:\sample\node_modules\@angular\cli\models\webpack-configs\index.js:9:10)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
First, I expect this simple project to run.
Then I would expect to run ng build --prod on another project
I am also getting same error...
+1
same... :(
ditto :(
Dupe #9427
+1, can confirm, it happened to me
+1
Same here
Duplicate of #9427
I've been trying to figure this problem out for about an hour, now.
I have uninstalled angular and reinstalled it.
I wasn't having this issue earlier and have no idea what could have changed that would cause me to run into this now. Any help would be awesome.
+1
Was not having this issue approx 4 or 5 hours ago.
Check the version of uglifyjs-webpack-plugin you are using in your package.json.
I was using 1.1.7 which broke my build a few hours ago, however, after installing the latest version via npm install --save uglifyjs-webpack-plugin It upgraded to 1.1.8 and now my build is fine...
Also see This post
I use 1.2.7 but I'm getting this error. I'm not creating a new one though. I tried removing node_modules and package-lock.json, to no avail.
"@angular-devkit/build-angular": "^0.6.8",
"@angular/cli": "^6.0.8",
"@angular/compiler-cli": "^5.2.0",
"@angular/language-service": "^5.2.0",
"uglifyjs-webpack-plugin": "^1.2.7"
https://github.com/jonasarcangel/ModuleIssue/tree/master/ClientApp.
yes is wright
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
Check the version of uglifyjs-webpack-plugin you are using in your package.json.
I was using
1.1.7which broke my build a few hours ago, however, after installing the latest version vianpm install --save uglifyjs-webpack-pluginIt upgraded to1.1.8and now my build is fine...Also see This post